Skip to content

Commit

Permalink
update specs, add Capybara matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchud committed Dec 11, 2024
1 parent b12f3db commit e20849c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
config.include EvaluationFormsHelper, type: :system
config.include PhasesHelper, type: :system
config.include EvaluationCriteriaHelpers, type: :system
config.include Capybara::RSpecMatchers, type: :request

config.include FactoryBot::Syntax::Methods
config.before(:suite) do
Expand Down
12 changes: 6 additions & 6 deletions spec/requests/submissions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
end

it "renders submission statistics" do
submission = create(:submission, challenge: challenge, phase: phase)
submission_2 = create(:submission, challenge: challenge, phase: phase, judging_status: "selected")

create(:submission, challenge: challenge, phase: phase)
create(:submission, challenge: challenge, phase: phase, judging_status: "selected")

get submissions_phase_path(phase)
expect(response.body).to include("Boston Tea Party Cleanup")
# total submissions
expect(response.body).to include("2")
# total submission count
expect(response.body).to have_css("h3.text-primary", text: "Total Submissions")
expect(response.body).to have_css("span.font-sans-3xl.text-primary.text-bold", text: "2")
# selected to advance
expect(response.body).to include("1 of 2")
expect(response.body).to have_css("span.text-primary", text: "1 of 2")
end
end

Expand Down

0 comments on commit e20849c

Please sign in to comment.