Fix several rubocop warnings

Metrics/LineLength: Line is too long.
RSpec/InstanceVariable: Use let instead of an instance variable.
Layout/TrailingBlankLines: Final newline missing.
Style/StringLiterals: Prefer double-quoted strings.
This commit is contained in:
Julian Herrero
2019-03-30 19:02:37 +01:00
parent 83e129d5b7
commit 6e88031537
14 changed files with 230 additions and 114 deletions

View File

@@ -38,7 +38,8 @@ describe GraphqlController, type: :request do
let(:json_headers) { { "CONTENT_TYPE" => "application/json" } }
specify "with json-encoded query string inside body" do
post "/graphql", params: { query: "{ proposal(id: #{proposal.id}) { title } }" }.to_json, headers: json_headers
post "/graphql", params: { query: "{ proposal(id: #{proposal.id}) { title } }" }.to_json,
headers: json_headers
expect(response).to have_http_status(:ok)
expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title)
@@ -46,7 +47,8 @@ describe GraphqlController, type: :request do
specify "with raw query string inside body" do
graphql_headers = { "CONTENT_TYPE" => "application/graphql" }
post "/graphql", params: "{ proposal(id: #{proposal.id}) { title } }", headers: graphql_headers
post "/graphql", params: "{ proposal(id: #{proposal.id}) { title } }",
headers: graphql_headers
expect(response).to have_http_status(:ok)
expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title)