-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[209] Submission Stats #280
Conversation
68d7200
to
cfeabcc
Compare
This will be updated with status from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review pass
cfeabcc
to
e5c9c0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I think) I made the necessary code changes as far as the stats component calculations and display. However, I would like to see some tests for this component. They should mostly be request specs in spec/requests/submissions_spec.rb
that assert the various stats are displayed correctly. Can we also add a spec/system/submissions_spec.rb
expectation that the stats show visible content on the page.
Co-authored-by: Stephen Chudleigh <stepchud@users.noreply.github.com>
spec/requests/submissions_spec.rb
Outdated
submission = create(:submission, challenge: challenge, phase: phase) | ||
submission_2 = create(:submission, challenge: challenge, phase: phase, judging_status: "selected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
spec/requests/submissions_spec.rb
Outdated
get submissions_phase_path(phase) | ||
expect(response.body).to include("Boston Tea Party Cleanup") | ||
# total submissions | ||
expect(response.body).to include("2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not testing much since the expect below also has a 2 in it, but I found a way to use css selectors that gives more specific expectations. the trick is to include Capybara::RSpecMatchers
in the request specs to enable the have_css()
matcher. I'll add this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work, I added the rspec matcher update e20849c
#209
Adds a stats component to the submissions list page for challenge managers.