Remove body_as_json
in favor of built-in response.parsed_body
for JSON response specs (#31749)
This commit is contained in:
parent
be77a1098b
commit
6b6a80b407
107 changed files with 422 additions and 413 deletions
|
@ -19,7 +19,7 @@ RSpec.describe 'Accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json.pluck(:id)).to match_array(expected_results.map { |a| a.id.to_s })
|
||||
expect(response.parsed_body.pluck(:id)).to match_array(expected_results.map { |a| a.id.to_s })
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -93,7 +93,7 @@ RSpec.describe 'Accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -112,7 +112,7 @@ RSpec.describe 'Accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match(
|
||||
expect(response.parsed_body).to match(
|
||||
a_hash_including(id: account.id.to_s, username: account.username, email: account.user.email)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
it 'returns an empty list' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -41,7 +41,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
it 'returns the correct canonical email hashes' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.pluck(:canonical_email_hash)).to match_array(expected_email_hashes)
|
||||
expect(response.parsed_body.pluck(:canonical_email_hash)).to match_array(expected_email_hashes)
|
||||
end
|
||||
|
||||
context 'with limit param' do
|
||||
|
@ -50,7 +50,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
it 'returns only the requested number of canonical email blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,7 +62,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
|
||||
canonical_email_blocks_ids = canonical_email_blocks.pluck(:id).map(&:to_s)
|
||||
|
||||
expect(body_as_json.pluck(:id)).to match_array(canonical_email_blocks_ids[2..])
|
||||
expect(response.parsed_body.pluck(:id)).to match_array(canonical_email_blocks_ids[2..])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -74,7 +74,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
|
||||
canonical_email_blocks_ids = canonical_email_blocks.pluck(:id).map(&:to_s)
|
||||
|
||||
expect(body_as_json.pluck(:id)).to match_array(canonical_email_blocks_ids[..2])
|
||||
expect(response.parsed_body.pluck(:id)).to match_array(canonical_email_blocks_ids[..2])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -96,7 +96,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json)
|
||||
expect(response.parsed_body)
|
||||
.to include(
|
||||
id: eq(canonical_email_block.id.to_s),
|
||||
canonical_email_hash: eq(canonical_email_block.canonical_email_hash)
|
||||
|
@ -142,7 +142,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[0][:canonical_email_hash]).to eq(canonical_email_block.canonical_email_hash)
|
||||
expect(response.parsed_body.first[:canonical_email_hash]).to eq(canonical_email_block.canonical_email_hash)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -151,7 +151,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -173,7 +173,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:canonical_email_hash]).to eq(canonical_email_block.canonical_email_hash)
|
||||
expect(response.parsed_body[:canonical_email_hash]).to eq(canonical_email_block.canonical_email_hash)
|
||||
end
|
||||
|
||||
context 'when the required email param is not provided' do
|
||||
|
@ -193,7 +193,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:canonical_email_hash]).to eq(params[:canonical_email_hash])
|
||||
expect(response.parsed_body[:canonical_email_hash]).to eq(params[:canonical_email_hash])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -204,7 +204,7 @@ RSpec.describe 'Canonical Email Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:canonical_email_hash]).to eq(canonical_email_block.canonical_email_hash)
|
||||
expect(response.parsed_body[:canonical_email_hash]).to eq(canonical_email_block.canonical_email_hash)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ RSpec.describe 'Admin Dimensions' do
|
|||
expect(response)
|
||||
.to have_http_status(200)
|
||||
|
||||
expect(body_as_json)
|
||||
expect(response.parsed_body)
|
||||
.to be_an(Array)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe 'Domain Allows' do
|
|||
it 'returns an empty body' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -49,7 +49,7 @@ RSpec.describe 'Domain Allows' do
|
|||
it 'returns the correct allowed domains' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_response)
|
||||
expect(response.parsed_body).to match_array(expected_response)
|
||||
end
|
||||
|
||||
context 'with limit param' do
|
||||
|
@ -58,7 +58,7 @@ RSpec.describe 'Domain Allows' do
|
|||
it 'returns only the requested number of allowed domains' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -79,7 +79,7 @@ RSpec.describe 'Domain Allows' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:domain]).to eq domain_allow.domain
|
||||
expect(response.parsed_body[:domain]).to eq domain_allow.domain
|
||||
end
|
||||
|
||||
context 'when the requested allowed domain does not exist' do
|
||||
|
@ -107,7 +107,7 @@ RSpec.describe 'Domain Allows' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:domain]).to eq 'foo.bar.com'
|
||||
expect(response.parsed_body[:domain]).to eq 'foo.bar.com'
|
||||
expect(DomainAllow.find_by(domain: 'foo.bar.com')).to be_present
|
||||
end
|
||||
end
|
||||
|
@ -140,7 +140,7 @@ RSpec.describe 'Domain Allows' do
|
|||
it 'returns the existing allowed domain name' do
|
||||
subject
|
||||
|
||||
expect(body_as_json[:domain]).to eq(params[:domain])
|
||||
expect(response.parsed_body[:domain]).to eq(params[:domain])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
it 'returns an empty list' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -64,7 +64,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
it 'returns the expected domain blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_responde)
|
||||
expect(response.parsed_body).to match_array(expected_responde)
|
||||
end
|
||||
|
||||
context 'with limit param' do
|
||||
|
@ -73,7 +73,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
it 'returns only the requested number of domain blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -94,19 +94,17 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match(
|
||||
{
|
||||
id: domain_block.id.to_s,
|
||||
domain: domain_block.domain,
|
||||
digest: domain_block.domain_digest,
|
||||
created_at: domain_block.created_at.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
|
||||
severity: domain_block.severity.to_s,
|
||||
reject_media: domain_block.reject_media,
|
||||
reject_reports: domain_block.reject_reports,
|
||||
private_comment: domain_block.private_comment,
|
||||
public_comment: domain_block.public_comment,
|
||||
obfuscate: domain_block.obfuscate,
|
||||
}
|
||||
expect(response.parsed_body).to match(
|
||||
id: domain_block.id.to_s,
|
||||
domain: domain_block.domain,
|
||||
digest: domain_block.domain_digest,
|
||||
created_at: domain_block.created_at.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
|
||||
severity: domain_block.severity.to_s,
|
||||
reject_media: domain_block.reject_media,
|
||||
reject_reports: domain_block.reject_reports,
|
||||
private_comment: domain_block.private_comment,
|
||||
public_comment: domain_block.public_comment,
|
||||
obfuscate: domain_block.obfuscate
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -134,7 +132,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match a_hash_including(
|
||||
expect(response.parsed_body).to match a_hash_including(
|
||||
{
|
||||
domain: 'foo.bar.com',
|
||||
severity: 'silence',
|
||||
|
@ -155,7 +153,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match a_hash_including(
|
||||
expect(response.parsed_body).to match a_hash_including(
|
||||
{
|
||||
domain: 'foo.bar.com',
|
||||
severity: 'suspend',
|
||||
|
@ -175,7 +173,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(body_as_json[:existing_domain_block][:domain]).to eq('foo.bar.com')
|
||||
expect(response.parsed_body[:existing_domain_block][:domain]).to eq('foo.bar.com')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -188,7 +186,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(body_as_json[:existing_domain_block][:domain]).to eq('bar.com')
|
||||
expect(response.parsed_body[:existing_domain_block][:domain]).to eq('bar.com')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -219,7 +217,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match a_hash_including(
|
||||
expect(response.parsed_body).to match a_hash_including(
|
||||
{
|
||||
id: domain_block.id.to_s,
|
||||
domain: domain_block.domain,
|
||||
|
|
|
@ -31,7 +31,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
it 'returns an empty list' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -42,7 +42,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
it 'return the correct blocked email domains' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.pluck(:domain)).to match_array(blocked_email_domains)
|
||||
expect(response.parsed_body.pluck(:domain)).to match_array(blocked_email_domains)
|
||||
end
|
||||
|
||||
context 'with limit param' do
|
||||
|
@ -51,7 +51,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
it 'returns only the requested number of email domain blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -63,7 +63,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
|
||||
email_domain_blocks_ids = email_domain_blocks.pluck(:id).map(&:to_s)
|
||||
|
||||
expect(body_as_json.pluck(:id)).to match_array(email_domain_blocks_ids[2..])
|
||||
expect(response.parsed_body.pluck(:id)).to match_array(email_domain_blocks_ids[2..])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -75,7 +75,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
|
||||
email_domain_blocks_ids = email_domain_blocks.pluck(:id).map(&:to_s)
|
||||
|
||||
expect(body_as_json.pluck(:id)).to match_array(email_domain_blocks_ids[..2])
|
||||
expect(response.parsed_body.pluck(:id)).to match_array(email_domain_blocks_ids[..2])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -97,7 +97,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:domain]).to eq(email_domain_block.domain)
|
||||
expect(response.parsed_body[:domain]).to eq(email_domain_block.domain)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -125,7 +125,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:domain]).to eq(params[:domain])
|
||||
expect(response.parsed_body[:domain]).to eq(params[:domain])
|
||||
end
|
||||
|
||||
context 'when domain param is not provided' do
|
||||
|
@ -176,7 +176,7 @@ RSpec.describe 'Email Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
expect(EmailDomainBlock.find_by(id: email_domain_block.id)).to be_nil
|
||||
end
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe 'IP Blocks' do
|
|||
it 'returns an empty body' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -58,7 +58,7 @@ RSpec.describe 'IP Blocks' do
|
|||
it 'returns the correct blocked ips' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_response)
|
||||
expect(response.parsed_body).to match_array(expected_response)
|
||||
end
|
||||
|
||||
context 'with limit param' do
|
||||
|
@ -67,7 +67,7 @@ RSpec.describe 'IP Blocks' do
|
|||
it 'returns only the requested number of ip blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -89,7 +89,7 @@ RSpec.describe 'IP Blocks' do
|
|||
|
||||
expect(response).to have_http_status(200)
|
||||
|
||||
expect(body_as_json)
|
||||
expect(response.parsed_body)
|
||||
.to include(
|
||||
ip: eq("#{ip_block.ip}/#{ip_block.ip.prefix}"),
|
||||
severity: eq(ip_block.severity.to_s)
|
||||
|
@ -120,7 +120,7 @@ RSpec.describe 'IP Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json)
|
||||
expect(response.parsed_body)
|
||||
.to include(
|
||||
ip: eq("#{params[:ip]}/32"),
|
||||
severity: eq(params[:severity]),
|
||||
|
@ -185,7 +185,7 @@ RSpec.describe 'IP Blocks' do
|
|||
.and change_comment_value
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match(hash_including({
|
||||
expect(response.parsed_body).to match(hash_including({
|
||||
ip: "#{ip_block.ip}/#{ip_block.ip.prefix}",
|
||||
severity: 'sign_up_requires_approval',
|
||||
comment: 'Decreasing severity',
|
||||
|
@ -220,7 +220,7 @@ RSpec.describe 'IP Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
expect(IpBlock.find_by(id: ip_block.id)).to be_nil
|
||||
end
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ RSpec.describe 'Admin Measures' do
|
|||
expect(response)
|
||||
.to have_http_status(200)
|
||||
|
||||
expect(body_as_json)
|
||||
expect(response.parsed_body)
|
||||
.to be_an(Array)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ RSpec.describe 'Reports' do
|
|||
it 'returns an empty list' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -64,7 +64,7 @@ RSpec.describe 'Reports' do
|
|||
it 'returns all unresolved reports' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_response)
|
||||
expect(response.parsed_body).to match_array(expected_response)
|
||||
end
|
||||
|
||||
context 'with resolved param' do
|
||||
|
@ -74,7 +74,7 @@ RSpec.describe 'Reports' do
|
|||
it 'returns only the resolved reports' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_response)
|
||||
expect(response.parsed_body).to match_array(expected_response)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -85,7 +85,7 @@ RSpec.describe 'Reports' do
|
|||
it 'returns all unresolved reports filed by the specified account' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_response)
|
||||
expect(response.parsed_body).to match_array(expected_response)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -96,7 +96,7 @@ RSpec.describe 'Reports' do
|
|||
it 'returns all unresolved reports targeting the specified account' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_response)
|
||||
expect(response.parsed_body).to match_array(expected_response)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -106,7 +106,7 @@ RSpec.describe 'Reports' do
|
|||
it 'returns only the requested number of reports' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(1)
|
||||
expect(response.parsed_body.size).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -126,7 +126,7 @@ RSpec.describe 'Reports' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to include(
|
||||
expect(response.parsed_body).to include(
|
||||
{
|
||||
id: report.id.to_s,
|
||||
action_taken: report.action_taken?,
|
||||
|
@ -159,7 +159,7 @@ RSpec.describe 'Reports' do
|
|||
|
||||
report.reload
|
||||
|
||||
expect(body_as_json).to include(
|
||||
expect(response.parsed_body).to include(
|
||||
{
|
||||
id: report.id.to_s,
|
||||
action_taken: report.action_taken?,
|
||||
|
|
|
@ -27,7 +27,7 @@ RSpec.describe 'Admin Retention' do
|
|||
expect(response)
|
||||
.to have_http_status(200)
|
||||
|
||||
expect(body_as_json)
|
||||
expect(response.parsed_body)
|
||||
.to be_an(Array)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ RSpec.describe 'Tags' do
|
|||
it 'returns an empty list' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -47,7 +47,7 @@ RSpec.describe 'Tags' do
|
|||
it 'returns the expected tags' do
|
||||
subject
|
||||
tags.each do |tag|
|
||||
expect(body_as_json.find { |item| item[:id] == tag.id.to_s && item[:name] == tag.name }).to_not be_nil
|
||||
expect(response.parsed_body.find { |item| item[:id] == tag.id.to_s && item[:name] == tag.name }).to_not be_nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -57,7 +57,7 @@ RSpec.describe 'Tags' do
|
|||
it 'returns only the requested number of tags' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -82,8 +82,8 @@ RSpec.describe 'Tags' do
|
|||
it 'returns expected tag content' do
|
||||
subject
|
||||
|
||||
expect(body_as_json[:id].to_i).to eq(tag.id)
|
||||
expect(body_as_json[:name]).to eq(tag.name)
|
||||
expect(response.parsed_body[:id].to_i).to eq(tag.id)
|
||||
expect(response.parsed_body[:name]).to eq(tag.name)
|
||||
end
|
||||
|
||||
context 'when the requested tag does not exist' do
|
||||
|
@ -116,8 +116,8 @@ RSpec.describe 'Tags' do
|
|||
it 'returns updated tag' do
|
||||
subject
|
||||
|
||||
expect(body_as_json[:id].to_i).to eq(tag.id)
|
||||
expect(body_as_json[:name]).to eq(tag.name.upcase)
|
||||
expect(response.parsed_body[:id].to_i).to eq(tag.id)
|
||||
expect(response.parsed_body[:name]).to eq(tag.name.upcase)
|
||||
end
|
||||
|
||||
context 'when the updated display name is invalid' do
|
||||
|
|
|
@ -44,7 +44,7 @@ RSpec.describe 'Links' do
|
|||
end
|
||||
|
||||
def expects_correct_link_data
|
||||
expect(body_as_json).to match(
|
||||
expect(response.parsed_body).to match(
|
||||
a_hash_including(
|
||||
url: preview_card.url,
|
||||
title: preview_card.title,
|
||||
|
@ -98,7 +98,7 @@ RSpec.describe 'Links' do
|
|||
it 'returns the link data' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match(
|
||||
expect(response.parsed_body).to match(
|
||||
a_hash_including(
|
||||
url: preview_card.url,
|
||||
title: preview_card.title,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue