-
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
[285] Adjust Challenge Phase index query for Evaluators #359
Conversation
spec/requests/evaluations_spec.rb
Outdated
) | ||
end | ||
|
||
it "only shows challenges with assigned submissions" do |
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.
👍 can we add some specs for including status: :recused
submissions and excluding status: :unassigned
and status: :recused_unassiged
?
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.
Sure!
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.
@stepchud I added is_multi_phase: false
to the spec to prevent the challenge factory from creating 3 phases for the challenge created. This is so the spec doesn't return challenge phases with no assigned submissions, which ends up looking like the behavior we're testing to avoid. 👍
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.
if the challenge is_muli_phase, and the evaluator is only assigned to one of the phases, we only want it to show that assigned phase in the list. probably the view should query for assigned/recused phases instead of challenges so that you can properly filter them? otherwise this isn't the correct behavior.
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.
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.
Yep, that makes sense - I'll fix the query and update the tests, thanks!
…r challenge phase index
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.
needs to filter for assigned phases on is_multi_phase challenges
spec/requests/evaluations_spec.rb
Outdated
expect(response.body).to have_css('td[data-label="Assigned to me"]') | ||
expect(response.body).to have_css('td[data-label="Assigned to me"]', text: '2') | ||
expect(response.body).to have_css('td[data-label="Remaining to evaluate"]') | ||
expect(response.body).to have_css('td[data-label="Remaining to evaluate"]', text: '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.
nit: these are duplicated expectations and can be collapsed to one line
expect(response.body).to have_css('td[data-label="Assigned to me"]') | |
expect(response.body).to have_css('td[data-label="Assigned to me"]', text: '2') | |
expect(response.body).to have_css('td[data-label="Remaining to evaluate"]') | |
expect(response.body).to have_css('td[data-label="Remaining to evaluate"]', text: '2') | |
expect(response.body).to have_css('td[data-label="Assigned to me"]', text: '2') | |
expect(response.body).to have_css('td[data-label="Remaining to evaluate"]', text: '2') |
spec/requests/evaluations_spec.rb
Outdated
) | ||
end | ||
|
||
it "only shows challenges with assigned submissions" do |
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.
if the challenge is_muli_phase, and the evaluator is only assigned to one of the phases, we only want it to show that assigned phase in the list. probably the view should query for assigned/recused phases instead of challenges so that you can properly filter them? otherwise this isn't the correct behavior.
…ed/recused submissions
@stepchud I've adjusted the query so it queries on phases in which that evaluator has assigned or recused submissions instead of challenges. The updated test now includes a multi-phase challenge. It checks that the evaluator only sees the phase of the multi-phase challenge in which they have assigned/recused submissions. And it still includes the expectations around including Lemme know what you think! Thanks! |
Related ticket: #285
The list of challenges should only show the challenges that the evaluator has assigned submissions to.