DEV: Use response.parsed_body in specs (#9615)

Most of it was autofixed with rubocop-discourse 2.1.1.
This commit is contained in:
Jarek Radosz
2020-05-07 17:04:12 +02:00
committed by GitHub
parent 69ef0da4c2
commit 781e3f5e10
70 changed files with 705 additions and 714 deletions

View File

@ -24,7 +24,7 @@ describe "DiscoursePoll endpoints" do
expect(response.status).to eq(200)
poll = JSON.parse(response.body)["voters"]
poll = response.parsed_body["voters"]
option = poll[option_a]
expect(option.length).to eq(1)
@ -48,7 +48,7 @@ describe "DiscoursePoll endpoints" do
expect(response.status).to eq(200)
poll = JSON.parse(response.body)["voters"]
poll = response.parsed_body["voters"]
expect(poll[option_a]).to eq(nil)
@ -112,7 +112,7 @@ describe "DiscoursePoll endpoints" do
expect(response.status).to eq(200)
poll = JSON.parse(response.body)["voters"]
poll = response.parsed_body["voters"]
expect(poll.first["id"]).to eq(user.id)
expect(poll.first["username"]).to eq(user.username)
@ -165,7 +165,7 @@ describe "DiscoursePoll endpoints" do
}
expect(response.status).to eq(200)
expect(JSON.parse(response.body).deep_symbolize_keys).to eq(
expect(response.parsed_body.deep_symbolize_keys).to eq(
grouped_results: [
{ group: "Value0", options: [{ digest: option_a, html: "A", votes: 1 }, { digest: option_b, html: "B", votes: 0 }] },
{ group: "Value1", options: [{ digest: option_a, html: "A", votes: 2 }, { digest: option_b, html: "B", votes: 1 }] },