Skip to content

Commit

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

title { Faker::Lorem.sentence }
status { "draft" }
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
8 changes: 2 additions & 6 deletions spec/system/submissions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
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 { system_login_user(user) }

it "manage submissions by challenge phase page is accessible with one challenge" do
challenge = create_challenge(user: user, title: "Boston Tea Party Cleanup")
phase = create_phase(challenge_id: challenge.id)
Expand Down

0 comments on commit 2bf547e

Please sign in to comment.