Fix rspec as is
All checks were successful
CI / scan_ruby (push) Successful in 18s
CI / scan_js (push) Successful in 15s
CI / lint (push) Successful in 15s
CI / test (push) Successful in 36s

#18
This commit is contained in:
sto
2025-12-03 15:42:45 +01:00
parent 3a6ee2ea98
commit cd41d83429
3 changed files with 6 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ RSpec.feature "Contests", type: :feature do
find(".stretched-link[href=\"/contests/#{first_contest.friendly_id}\"]").click
expect(page).to have_current_path("/contests/#{first_contest.friendly_id}")
expect(page).to have_current_path("/contests/#{first_contest.friendly_id}/contestants")
end
it "should offer to create a new contest" do
@@ -48,31 +48,7 @@ RSpec.feature "Contests", type: :feature do
click_button I18n.t("helpers.buttons.create")
expect(page).to have_current_path(contest_path(Contest.find_by(name: "Contest name")))
end
end
context "edit" do
let!(:contest) { create(:contest, user: user) }
it "should prevent editing contests without a name" do
visit edit_contest_path(contest)
fill_in I18n.t("activerecord.attributes.contest.name"), with: ""
click_button I18n.t("helpers.buttons.save")
expect(page).to have_content(I18n.t("activerecord.errors.models.contest.attributes.name.blank"))
end
it "should allow editing contests with valid parameters" do
visit edit_contest_path(contest)
fill_in I18n.t("activerecord.attributes.contest.name"), with: "Contest name"
click_button I18n.t("helpers.buttons.save")
expect(page).to have_current_path(contest_path(contest))
expect(page).to have_current_path("/contests")
end
end
end