Skip to content

Commit

Permalink
Jump straight to states page within configuration/states_spec test
Browse files Browse the repository at this point in the history
An attempt to make the states_spec more reliable. Currently it's hanging on general_settings/edit
  • Loading branch information
radar committed Dec 11, 2012
1 parent c5dc87a commit da76c17
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/spec/requests/admin/configuration/states_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
before(:each) do
@hungary = Spree::Country.create!(:name => "Hungary", :iso_name => "Hungary")
Spree::Config[:default_country_id] = country.id

visit spree.admin_path
click_link "Configuration"
end

# TODO: For whatever reason, rendering of the states page takes a non-trivial amount of time
# Therefore we navigate to it, and wait until what we see is visible
def go_to_states_page
click_link "States"
visit spree.admin_country_states_path(country)
counter = 0
until page.has_css?("#new_state_link")
if counter < 10
Expand All @@ -32,7 +29,7 @@ def go_to_states_page
let!(:state) { create(:state, :country => country) }

it "should correctly display the states" do
click_link "States"
visit spree.admin_country_states_path(country)
page.should have_content(state.name)
end
end
Expand Down

0 comments on commit da76c17

Please sign in to comment.