Attempt to fix the "I should see that I am [un]subscribed" steps

Makes use of Capybara methods that wait. Hopefully this will fix the
random timing-related failures of this step.
This commit is contained in:
Robert Speicher 2015-06-19 17:08:48 -04:00
parent 6288677134
commit d92bb3cfe0
2 changed files with 4 additions and 5 deletions

View file

@ -19,12 +19,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end end
step 'I should see that I am subscribed' do step 'I should see that I am subscribed' do
expect(find(".subscribe-button span").text).to eq "Unsubscribe" expect(find('.subscribe-button span')).to have_content 'Unsubscribe'
end end
step 'I should see that I am unsubscribed' do step 'I should see that I am unsubscribed' do
sleep 0.2 expect(find('.subscribe-button span')).to have_content 'Subscribe'
expect(find(".subscribe-button span").text).to eq "Subscribe"
end end
step 'I click link "Closed"' do step 'I click link "Closed"' do

View file

@ -58,11 +58,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
step 'I should see that I am subscribed' do step 'I should see that I am subscribed' do
expect(find(".subscribe-button span").text).to eq "Unsubscribe" expect(find('.subscribe-button span')).to have_content 'Unsubscribe'
end end
step 'I should see that I am unsubscribed' do step 'I should see that I am unsubscribed' do
expect(find(".subscribe-button span")).to have_content("Subscribe") expect(find('.subscribe-button span')).to have_content 'Subscribe'
end end
step 'I click button "Unsubscribe"' do step 'I click button "Unsubscribe"' do