diff --git a/spec/features/competitions_list_spec.rb b/spec/features/competitions_list_spec.rb index 8eaabb327ee..453e4905872 100644 --- a/spec/features/competitions_list_spec.rb +++ b/spec/features/competitions_list_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -RSpec.feature "Competitions list" do +RSpec.feature "Competitions list", js: true do context "admin view" do before :each do sign_in FactoryBot.create(:admin) @@ -13,18 +13,18 @@ let(:delegate) { competition.delegates.first } before do - visit "/competitions?legacy=off&show_admin_details=yes" + visit "/competitions?show_admin_details=yes" within(:css, "#delegate") do find(".search").set(delegate.name) find(".search").send_keys(:enter) end end - it "the delegate is selected within the form", js: true do + it "the delegate is selected within the form" do expect(page.find("#competition-query-form #delegate")).to have_text(delegate.name) end - it "only competitions delegated by the given delegate are shown", js: true do + it "only competitions delegated by the given delegate are shown" do expect(page).to have_selector(".competition-info", count: 1) end end @@ -33,11 +33,11 @@ FactoryBot.create(:competition, :visible, starts: 2.days.ago, name: "Test Comp 2017") visit '/competitions?state=recent&display=admin' expect(page).to have_http_status(200) + expect(page).to have_text "Test Comp 2017" tr = page.find("tr", text: "Test Comp 2017") - results_td = tr.find("td:nth-child(6).admin-date") - expect(results_td.text).to eq "pending" - expect(results_td[:class].split).to match_array %w(admin-date) + results_td = tr.find("td:nth-child(7)") + expect(results_td.text).to eq "Pending" end end end