From da425b9164eff61be86d07ad59d95df554bda8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 23 Sep 2019 23:01:05 +0200 Subject: [PATCH] Remove commented graphql code This code was commented in commit ad8aba07. --- config/api.yml | 6 ------ spec/lib/graphql_spec.rb | 15 --------------- 2 files changed, 21 deletions(-) diff --git a/config/api.yml b/config/api.yml index 20dd8c7a7..0814d5552 100644 --- a/config/api.yml +++ b/config/api.yml @@ -5,7 +5,6 @@ User: public_debates: [Debate] public_proposals: [Proposal] public_comments: [Comment] -# organization: Organization Debate: fields: id: integer @@ -81,8 +80,3 @@ Vote: votable_type: string public_created_at: string vote_flag: boolean -# Organization: -# fields: -# id: integer -# user_id: integer -# name: string diff --git a/spec/lib/graphql_spec.rb b/spec/lib/graphql_spec.rb index 181775e47..d3a02cb54 100644 --- a/spec/lib/graphql_spec.rb +++ b/spec/lib/graphql_spec.rb @@ -49,12 +49,6 @@ describe "Consul Schema" do expect(dig(response, "data.proposal.title")).to eq(proposal.title) end - xit "returns has_one associations" do - organization = create(:organization) - response = execute("{ user(id: #{organization.user_id}) { organization { name } } }") - expect(dig(response, "data.user.organization.name")).to eq(organization.name) - end - it "returns belongs_to associations" do response = execute("{ proposal(id: #{proposal.id}) { public_author { username } } }") expect(dig(response, "data.proposal.public_author.username")).to eq(proposal.public_author.username) @@ -72,15 +66,6 @@ describe "Consul Schema" do expect(comment_bodies).to match_array([comment_1.body, comment_2.body]) end - xit "executes deeply nested queries" do - org_user = create(:user) - organization = create(:organization, user: org_user) - org_proposal = create(:proposal, author: org_user) - response = execute("{ proposal(id: #{org_proposal.id}) { public_author { organization { name } } } }") - - expect(dig(response, "data.proposal.public_author.organization.name")).to eq(organization.name) - end - it "hides confidential fields of Int type" do response = execute("{ user(id: #{user.id}) { failed_census_calls_count } }") expect(hidden_field?(response, "failed_census_calls_count")).to be_truthy