diff --git a/spec/system/admin/configuration/states_spec.rb b/spec/system/admin/configuration/states_spec.rb index 9512415f85..f7f58c9edc 100644 --- a/spec/system/admin/configuration/states_spec.rb +++ b/spec/system/admin/configuration/states_spec.rb @@ -16,17 +16,11 @@ RSpec.describe "States" do allow(ENV).to receive(:[]).with("DEFAULT_COUNTRY_CODE").and_return("HU") 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 + # 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 visit spree.admin_country_states_path(country) - counter = 0 - until page.has_css?("#new_state_link") - raise "Could not see new state link!" if counter >= 10 - - sleep(2) - counter += 1 - end + expect(page).to have_link "New State" end context "admin visiting states listing" do