Sha256: 4a270c06bd351ab5095f95e62a66752f07fa2c1683f8440f12590b31fdcc5ae6

Contents?: true

Size: 910 Bytes

Versions: 20

Compression:

Stored size: 910 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"
require "decidim/api/test/type_context"

module Decidim
  module Api
    describe MutationType do
      include_context "graphql type"

      describe "commentable" do
        let!(:commentable) { create(:dummy_resource) }
        let(:query) do
          "{ commentable(id: \"#{commentable.id}\", type: \"#{commentable.commentable_type}\") { id } }"
        end

        it "should fetch the commentable given its id and commentable_type" do
          expect(response["commentable"]).to include("id" => commentable.id.to_s)
        end
      end

      describe "comment" do
        let!(:comment) { create(:comment) }
        let(:query) { "{ comment(id: \"#{comment.id}\") { id } }" }

        it "should fetch the comment given its id" do
          expect(response["comment"]).to include("id" => comment.id.to_s)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.7 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.6 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.5 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.4 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.3 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.2 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.1 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.6.0 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.5.1 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.5.0 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.4.4 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.4.3 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.4.2 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.4.1 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.4.0 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.3.2 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.3.1 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.3.0 decidim-comments/spec/types/mutation_type_spec.rb
decidim-0.2.0 decidim-comments/spec/types/mutation_type_spec.rb