Skip to content
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

Fix or remove xit-ignored test in spec/requests/case_assignments_spec.rb:353 'does not toggle contacts visibility' #5669

Closed
Tracked by #5727
compwron opened this issue May 5, 2024 · 0 comments · Fixed by #5812

Comments

@compwron
Copy link
Collaborator

compwron commented May 5, 2024

Fix or remove xit-ignored test in spec/requests/case_assignments_spec.rb:353 'does not toggle contacts visibility'

solebared added a commit that referenced this issue Jun 3, 2024
In addressing issue #5669, it seemed that this endpoint should only be
called for in inactive case_assignment. If that premise holds, then we
no longer need the `else` conditional that attempts to `render :edit`,
which would actually result in an error since this controller doesn't
support an edit action or view.

That error was surfacing in a spec that had been skipped.

If my hypothesis holds, then we can:
* Disallow access to this endpoint via policy if the case_assignment is
  inactive
* Remove the conditional and always toggle :hide_old_contacts if
  authorized
* Change policy and request specs accordingly
elasticspoon pushed a commit that referenced this issue Jun 14, 2024
…nding skipped spec (#5812)

* show_or_hide_contacts endpoint doesn't need to render :edit

In addressing issue #5669, it seemed that this endpoint should only be
called for in inactive case_assignment. If that premise holds, then we
no longer need the `else` conditional that attempts to `render :edit`,
which would actually result in an error since this controller doesn't
support an edit action or view.

That error was surfacing in a spec that had been skipped.

If my hypothesis holds, then we can:
* Disallow access to this endpoint via policy if the case_assignment is
  inactive
* Remove the conditional and always toggle :hide_old_contacts if
  authorized
* Change policy and request specs accordingly

* Remove unnecessary and confusing CaseAssignmentPolicy#hide_contacts?

H/T @elasticspoon:
#5812 (comment)

* Add CaseAssignment#inactive? helper

Because assignment.inactive? is easier to grok than !assignment.active?

H/T @elasticspoon:
#5812 (comment)

* Amend and use same_org method from ApplicationPolicy

* Use admin_or_supervisor_same_org? from ApplicationPolicy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant