Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #219 from mssola/acceptance-fixes
Browse files Browse the repository at this point in the history
spec: wait for events on the right element
  • Loading branch information
flavio committed Jul 10, 2015
2 parents 6a651ac + 23330b9 commit d15348d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions spec/features/namespaces_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

visit namespaces_path
find('#add_namespace_btn').click
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')

click_button 'Create'
wait_for_ajax
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')
expect(Namespace.count).to eql namespaces_count
expect(current_path).to eql namespaces_path
end
Expand All @@ -32,7 +32,7 @@
find('#add_namespace_btn').click
fill_in 'Namespace', with: Namespace.first.name
fill_in 'Team', with: Team.first.name
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')

click_button 'Create'
wait_for_ajax
Expand All @@ -50,11 +50,11 @@
find('#add_namespace_btn').click
fill_in 'Namespace', with: 'valid-namespace'
fill_in 'Team', with: namespace.team.name
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')

click_button 'Create'
wait_for_ajax
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')

expect(Namespace.count).to eql namespaces_count + 1
expect(current_path).to eql namespaces_path
Expand All @@ -72,13 +72,13 @@
expect(page).to_not have_css('#add_namespace_btn i.fa-minus-circle')

find('#add_namespace_btn').click
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')

expect(page).to_not have_css('#add_namespace_btn i.fa-plus-circle')
expect(page).to have_css('#add_namespace_btn i.fa-minus-circle')

find('#add_namespace_btn').click
wait_for_effect_on('#new-namespace-form')
wait_for_effect_on('#add_namespace_form')

expect(page).to have_css('#add_namespace_btn i.fa-plus-circle')
expect(page).to_not have_css('#add_namespace_btn i.fa-minus-circle')
Expand Down
14 changes: 7 additions & 7 deletions spec/features/teams_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

visit teams_path
find('#add_team_btn').click
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')

click_button 'Add'
wait_for_ajax
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')
expect(Team.count).to eql teams_count
expect(current_path).to eql teams_path
end
Expand All @@ -30,7 +30,7 @@
visit teams_path
find('#add_team_btn').click
fill_in 'Name', with: Team.first.name
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')

click_button 'Add'
wait_for_ajax
Expand All @@ -47,11 +47,11 @@
visit teams_path
find('#add_team_btn').click
fill_in 'Name', with: 'valid-team'
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')

click_button 'Add'
wait_for_ajax
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')
expect(Team.count).to eql teams_count + 1
expect(current_path).to eql teams_path
expect(page).to have_content('valid-team')
Expand All @@ -63,13 +63,13 @@
expect(page).to_not have_css('#add_team_btn i.fa-minus-circle')

find('#add_team_btn').click
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')

expect(page).to_not have_css('#add_team_btn i.fa-plus-circle')
expect(page).to have_css('#add_team_btn i.fa-minus-circle')

find('#add_team_btn').click
wait_for_effect_on('#new-team-form')
wait_for_effect_on('#add_team_form')

expect(page).to have_css('#add_team_btn i.fa-plus-circle')
expect(page).to_not have_css('#add_team_btn i.fa-minus-circle')
Expand Down

0 comments on commit d15348d

Please sign in to comment.