From dd1e6992668cfea203ea6a7de6985e218fd19f7c Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Thu, 5 Mar 2020 13:01:12 -0800 Subject: [PATCH] [Graphql] Fix failing tests --- spec/requests/api/graphql/create_spec.rb | 26 ++++++++++++------------ spec/requests/api/graphql/update_spec.rb | 18 ++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/spec/requests/api/graphql/create_spec.rb b/spec/requests/api/graphql/create_spec.rb index 8d789eefc..123c3dd34 100644 --- a/spec/requests/api/graphql/create_spec.rb +++ b/spec/requests/api/graphql/create_spec.rb @@ -15,9 +15,9 @@ let(:create_mutation) do <<-GRAPHQL mutation { - createConsignmentSubmission(input: { state: REJECTED, clientMutationId: "2", artist_id: "andy", title: "soup", category: JEWELRY, minimum_price_dollars: 50000, currency: "GBP" }){ + createConsignmentSubmission(input: { state: REJECTED, clientMutationId: "2", artistID: "andy", title: "soup", category: JEWELRY, minimumPriceDollars: 50000, currency: "GBP" }){ clientMutationId - consignment_submission { + consignmentSubmission { id title category @@ -34,7 +34,7 @@ <<-GRAPHQL mutation { createConsignmentSubmission(input: { title: "soup" }){ - consignment_submission { + consignmentSubmission { id title } @@ -66,7 +66,7 @@ params: { query: create_mutation }, headers: { 'Authorization' => "Bearer #{user_token}" } expect(response.status).to eq 200 - body = JSON.parse(response.body) + body = JSON.parse(response.body) # byebug expect(body['data']['createConsignmentSubmission']).to eq nil expect( body['errors'][0]['message'] @@ -90,32 +90,32 @@ expect(response.status).to eq 200 body = JSON.parse(response.body) expect( - body['data']['createConsignmentSubmission']['consignment_submission'][ + body['data']['createConsignmentSubmission']['consignmentSubmission'][ 'id' ] ).not_to be_nil expect( - body['data']['createConsignmentSubmission']['consignment_submission'][ + body['data']['createConsignmentSubmission']['consignmentSubmission'][ 'title' ] ).to eq 'soup' expect( - body['data']['createConsignmentSubmission']['consignment_submission'][ + body['data']['createConsignmentSubmission']['consignmentSubmission'][ 'category' ] ).to eq 'JEWELRY' expect( - body['data']['createConsignmentSubmission']['consignment_submission'][ + body['data']['createConsignmentSubmission']['consignmentSubmission'][ 'state' ] ).to eq 'REJECTED' expect( - body['data']['createConsignmentSubmission']['consignment_submission'][ + body['data']['createConsignmentSubmission']['consignmentSubmission'][ 'minimum_price_dollars' ] ).to eq 50_000 expect( - body['data']['createConsignmentSubmission']['consignment_submission'][ + body['data']['createConsignmentSubmission']['consignmentSubmission'][ 'currency' ] ).to eq 'GBP' @@ -135,9 +135,9 @@ create_asset = <<-GRAPHQL mutation { - addAssetToConsignmentSubmission(input: { clientMutationId: "test", submission_id: #{ + addAssetToConsignmentSubmission(input: { clientMutationId: "test", submissionID: #{ submission.id - }, gemini_token: "gemini-token-hash" }){ + }, geminiToken: "gemini-token-hash" }){ clientMutationId asset { id @@ -150,7 +150,7 @@ post '/api/graphql', params: { query: create_asset }, headers: headers expect(response.status).to eq 200 - body = JSON.parse(response.body) + body = JSON.parse(response.body) # byebug expect( body['data']['addAssetToConsignmentSubmission']['asset']['id'] ).not_to be_nil diff --git a/spec/requests/api/graphql/update_spec.rb b/spec/requests/api/graphql/update_spec.rb index 5b529d244..23883604f 100644 --- a/spec/requests/api/graphql/update_spec.rb +++ b/spec/requests/api/graphql/update_spec.rb @@ -26,9 +26,9 @@ mutation { updateConsignmentSubmission(input: { state: DRAFT, category: JEWELRY, clientMutationId: "test", id: #{ submission.id - }, artist_id: "andy-warhol", title: "soup" }){ + }, artistID: "andy-warhol", title: "soup" }){ clientMutationId - consignment_submission { + consignmentSubmission { category state id @@ -43,9 +43,9 @@ let(:update_mutation_random_id) do <<-GRAPHQL mutation { - updateConsignmentSubmission(input: { clientMutationId: "test", id: 999999, artist_id: "andy-warhol", title: "soup" }){ + updateConsignmentSubmission(input: { clientMutationId: "test", id: 999999, artistID: "andy-warhol", title: "soup" }){ clientMutationId - consignment_submission { + consignmentSubmission { id artist_id title @@ -114,28 +114,28 @@ expect(response.status).to eq 200 body = JSON.parse(response.body) expect( - body['data']['updateConsignmentSubmission']['consignment_submission'][ + body['data']['updateConsignmentSubmission']['consignmentSubmission'][ 'id' ] .to_i ).to eq submission.id expect( - body['data']['updateConsignmentSubmission']['consignment_submission'][ + body['data']['updateConsignmentSubmission']['consignmentSubmission'][ 'title' ] ).to eq 'soup' expect( - body['data']['updateConsignmentSubmission']['consignment_submission'][ + body['data']['updateConsignmentSubmission']['consignmentSubmission'][ 'artist_id' ] ).to eq 'andy-warhol' expect( - body['data']['updateConsignmentSubmission']['consignment_submission'][ + body['data']['updateConsignmentSubmission']['consignmentSubmission'][ 'category' ] ).to eq 'JEWELRY' expect( - body['data']['updateConsignmentSubmission']['consignment_submission'][ + body['data']['updateConsignmentSubmission']['consignmentSubmission'][ 'state' ] ).to eq 'DRAFT'