Skip to content

Fix HTML Escape String Comparison in Test supervisor_datatable_spec #… - #2825

Merged
FireLemons merged 1 commit into
rubyforgood:mainfrom
roseliux:issue-2810-html-scape-string
Oct 23, 2021
Merged

Fix HTML Escape String Comparison in Test supervisor_datatable_spec #…#2825
FireLemons merged 1 commit into
rubyforgood:mainfrom
roseliux:issue-2810-html-scape-string

Conversation

@roseliux

Copy link
Copy Markdown
Contributor

…2810

  • Add a supervisor with an apostrophe in their name to the list of inactive supervisors before running the test

What github issue is this PR for, if any?

Resolves#2810

What changed, and why?

Add a supervisor with an apostrophe in their name to the list of inactive supervisors before running the test.

Comment on lines +45 to +46
expect(subject[:data].map { |d| Nokogiri::HTML(d[:display_name]).text }).to include(active_supervisor.display_name)
expect(subject[:data].map { |d| Nokogiri::HTML(d[:display_name]).text }).to include(inactive_supervisor.display_name)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nokogiri::HTML is an alias for Nokogiri::HTML4 I think you want HTML5

@roseliuxroseliuxOct 22, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nokogiri.HTML5 was introduce on version v1.12.0 I believe and casa use "1.11.7"
https://nokogiri.org/rdoc/Nokogiri/HTML5.html
should i update as part of this PR?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update seems like is not supported by other dependencies

➜ bundle update nokogiri
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies......................
Bundler could not find compatible versions for gem "azure-storage-blob":
In snapshot (Gemfile.lock):
azure-storage-blob (= 2.0.1)
In Gemfile:
azure-storage-blob
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
nokogiri (>= 1.12.0)
azure-storage-blob was resolved to 2.0.1, which depends on
nokogiri (~> 1.11.0.rc2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just use this instead
image

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @FireLemons please review again.

@roseliux
roseliuxforce-pushed the issue-2810-html-scape-string branch from 9c68134 to a2d0022CompareOctober 22, 2021 16:25
@FireLemons

Copy link
Copy Markdown
Collaborator

could you run bundle exec standardrb --fix and commit again?

…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
roseliuxforce-pushed the issue-2810-html-scape-string branch from a2d0022 to 919f8dbCompareOctober 22, 2021 20:54
@FireLemons

Copy link
Copy Markdown
Collaborator

🏅

@FireLemons
FireLemons merged commit c4355b4 into rubyforgood:mainOct 23, 2021
@roseliux
roseliux deleted the issue-2810-html-scape-string branch January 14, 2022 18:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rubyTouches Ruby code🧪 TestsTests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix HTML Escape String Comparison in Test supervisor_datatable_spec

3 participants

@roseliux@FireLemons@compwron