mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 23:31:18 +08:00
DEV: Use response.parsed_body
in specs (#9615)
Most of it was autofixed with rubocop-discourse 2.1.1.
This commit is contained in:
@ -29,7 +29,7 @@ describe Admin::DashboardController do
|
||||
get "/admin/dashboard.json"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(JSON.parse(response.body)['version_check']).to be_present
|
||||
expect(response.parsed_body['version_check']).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
@ -41,7 +41,7 @@ describe Admin::DashboardController do
|
||||
it 'does not return discourse version info' do
|
||||
get "/admin/dashboard.json"
|
||||
expect(response.status).to eq(200)
|
||||
json = JSON.parse(response.body)
|
||||
json = response.parsed_body
|
||||
expect(json['version_check']).not_to be_present
|
||||
end
|
||||
end
|
||||
@ -57,7 +57,7 @@ describe Admin::DashboardController do
|
||||
get "/admin/dashboard/problems.json"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
json = JSON.parse(response.body)
|
||||
json = response.parsed_body
|
||||
expect(json['problems'].size).to eq(0)
|
||||
end
|
||||
end
|
||||
@ -70,7 +70,7 @@ describe Admin::DashboardController do
|
||||
it 'returns an array of strings' do
|
||||
get "/admin/dashboard/problems.json"
|
||||
expect(response.status).to eq(200)
|
||||
json = JSON.parse(response.body)
|
||||
json = response.parsed_body
|
||||
expect(json['problems'].size).to eq(2)
|
||||
expect(json['problems'][0]).to be_a(String)
|
||||
expect(json['problems'][1]).to be_a(String)
|
||||
|
Reference in New Issue
Block a user