BigW Consortium Gitlab

Commit 7b79ec07 by Stan Hu

Fix milestone Spinach tests by confirming modal only if it is present

parent dda33bd7
...@@ -3,6 +3,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps ...@@ -3,6 +3,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedPaths include SharedPaths
include SharedMarkdown include SharedMarkdown
include CapybaraHelpers
step 'I should see milestone "v2.2"' do step 'I should see milestone "v2.2"' do
milestone = @project.milestones.find_by(title: "v2.2") milestone = @project.milestones.find_by(title: "v2.2")
...@@ -63,7 +64,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps ...@@ -63,7 +64,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
end end
step 'I click link to remove milestone' do step 'I click link to remove milestone' do
click_link 'Delete' confirm_modal_if_present { click_link 'Delete' }
end end
step 'I should see no milestones' do step 'I should see no milestones' do
......
module CapybaraHelpers
def confirm_modal_if_present
if Capybara.current_driver == Capybara.javascript_driver
accept_confirm { yield }
return
end
yield
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment