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 HTML Escape String Comparison in Test supervisor_datatable_spec #2810

Closed
FireLemons opened this issue Oct 19, 2021 · 2 comments · Fixed by #2825
Closed

Fix HTML Escape String Comparison in Test supervisor_datatable_spec #2810

FireLemons opened this issue Oct 19, 2021 · 2 comments · Fixed by #2825
Assignees

Comments

@FireLemons
Copy link
Collaborator

FireLemons commented Oct 19, 2021

Current Behavior

spec/datatables/supervisor_datatable_spec.rb contains a test that does not expect an HTML escaped string

Failures:

  1) SupervisorDatatable filter active when both brings only all supervisors
     Failure/Error: expect(subject[:data].map { |d| d[:display_name] }).to include(inactive_supervisor.display_name)
       expected ["Maurine Mertz", "Neil O'Reilly"] to include "Neil O'Reilly"
     # ./spec/datatables/supervisor_datatable_spec.rb:45:in `block (5 levels) in <top (required)>'

Finished in 8 minutes 12 seconds (files took 9.38 seconds to load)
1483 examples, 1 failure, 1 pending

Failed examples:

rspec ./spec/datatables/supervisor_datatable_spec.rb:41 # SupervisorDatatable filter active when both brings only all supervisors

Expected Behavior

Expect the display names to include the HTML escaped version of the display name

How to Replicate

ex:

  1. Add a supervisor with an apostrophe in their name to the list of inactive supervisors before running the test
  2. bundle exec rspec spec/datatables/supervisor_datatable_spec.rb

Questions? Join Slack!

We highly recommend that you join us in slack https://rubyforgood.herokuapp.com/ #casa channel to ask questions quickly and hear about office hours (currently Wednesday 6-8pm Pacific), stakeholder news, and upcoming new issues.

@FireLemons FireLemons added Help Wanted This is a special label that enables github to showcase issues that want help Good First Issue labels Oct 19, 2021
@FireLemons FireLemons changed the title Fix HTML Escape Flake in test Fix HTML Escape String Comparison in test Oct 19, 2021
@FireLemons FireLemons changed the title Fix HTML Escape String Comparison in test Fix HTML Escape String Comparison in Test Oct 19, 2021
@compwron compwron changed the title Fix HTML Escape String Comparison in Test Fix HTML Escape String Comparison in Test supervisor_datatable_spec Oct 21, 2021
@FireLemons FireLemons added the Hacktoberfest Do good, get swag. label Oct 21, 2021
@roseliux
Copy link
Contributor

I can take this issue, please assign to me. @FireLemons

roseliux added a commit to roseliux/casa that referenced this issue Oct 21, 2021
…ubyforgood#2810

- Add a supervisor with an apostrophe in their name to the list of inactive supervisors before running the test
@roseliux
Copy link
Contributor

@FireLemons please review my PR #2825

roseliux added a commit to roseliux/casa that referenced this issue Oct 22, 2021
…ubyforgood#2810

- Add a supervisor with an apostrophe in their name to the list of inactive supervisors before running the test
- Use CGI::escapeHTML
roseliux added a commit to roseliux/casa that referenced this issue Oct 22, 2021
…ubyforgood#2810

- Add a supervisor with an apostrophe in their name to the list of inactive supervisors before running the test
- Use CGI::escapeHTML
@github-actions github-actions bot removed the Help Wanted This is a special label that enables github to showcase issues that want help label Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants