mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01:00
Use response.parsed_body
for html response checks (#31750)
This commit is contained in:
parent
fe04291af4
commit
e1b5f3fc6f
@ -48,7 +48,7 @@ RSpec.describe Admin::AccountsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def accounts_table_rows
|
def accounts_table_rows
|
||||||
Nokogiri::Slop(response.body).css('table.accounts-table tr')
|
response.parsed_body.css('table.accounts-table tr')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ RSpec.describe Admin::ExportDomainBlocksController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def batch_table_rows
|
def batch_table_rows
|
||||||
Nokogiri::Slop(response.body).css('body div.batch-table__row')
|
response.parsed_body.css('body div.batch-table__row')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ RSpec.describe Admin::InstancesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def instance_directory_links
|
def instance_directory_links
|
||||||
Nokogiri::Slop(response.body).css('div.directory__tag a')
|
response.parsed_body.css('div.directory__tag a')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ RSpec.describe Auth::RegistrationsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def username_error_text
|
def username_error_text
|
||||||
Nokogiri::Slop(response.body).css('.user_account_username .error').text
|
response.parsed_body.css('.user_account_username .error').text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,14 +18,16 @@ RSpec.describe 'The account show page' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def head_link_icons
|
def head_link_icons
|
||||||
head_section.css('link[rel=icon]')
|
response
|
||||||
|
.parsed_body
|
||||||
|
.search('html head link[rel=icon]')
|
||||||
end
|
end
|
||||||
|
|
||||||
def head_meta_content(property)
|
def head_meta_content(property)
|
||||||
head_section.meta("[@property='#{property}']")[:content]
|
response
|
||||||
end
|
.parsed_body
|
||||||
|
.search("html head meta[property='#{property}']")
|
||||||
def head_section
|
.attr('content')
|
||||||
Nokogiri::Slop(response.body).html.head
|
.text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user