Use response.parsed_body
for html response checks (#31750)
This commit is contained in:
parent
fe04291af4
commit
e1b5f3fc6f
5 changed files with 12 additions and 10 deletions
|
@ -18,14 +18,16 @@ RSpec.describe 'The account show page' do
|
|||
end
|
||||
|
||||
def head_link_icons
|
||||
head_section.css('link[rel=icon]')
|
||||
response
|
||||
.parsed_body
|
||||
.search('html head link[rel=icon]')
|
||||
end
|
||||
|
||||
def head_meta_content(property)
|
||||
head_section.meta("[@property='#{property}']")[:content]
|
||||
end
|
||||
|
||||
def head_section
|
||||
Nokogiri::Slop(response.body).html.head
|
||||
response
|
||||
.parsed_body
|
||||
.search("html head meta[property='#{property}']")
|
||||
.attr('content')
|
||||
.text
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue