Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchud committed Nov 15, 2024
1 parent 2681b81 commit a54f5e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions spec/factories/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
association :challenge
association :phase
association :submitter, factory: :user
association :manager, factory: :user
# don't think we need this anymore?
# association :manager, factory: :user

Expand Down
3 changes: 1 addition & 2 deletions spec/requests/phases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
end

it "renders a list of challenges" do
agency = Agency.create!(name: "Gandalf and Sons", acronym: "GAD")
challenge = Challenge.create!(user: challenge_user, agency:, title: "Turning monster energy into pepto bismol")
challenge = create(:challenge, user: challenge_user, title: "Turning monster energy into pepto bismol")
phase = create_phase(challenge_id: challenge.id)
ChallengeManager.create(user: challenge_user, challenge:)
create_evaluation_form(title: "Frodo", challenge_id: challenge.id, phase_id: phase.id)
Expand Down
10 changes: 4 additions & 6 deletions spec/system/phases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
require 'rails_helper'

describe "A11y", :js do
let(:user) { nil }

before do
system_login_user(user) if user
end

describe "Logged-in as a Challenge Manager" do
let(:user) { create_user(role: "challenge_manager") }

before do
system_login_user(user)
end

it "manage phases index page is accessible with no challenges" do
visit phases_path
expect(user.role).to eq("challenge_manager")
Expand Down

0 comments on commit a54f5e9

Please sign in to comment.