Sha256: 7db715e89053666adaa7f16e0fb6a5931b011420543775d3a032087c58eb625f

Contents?: true

Size: 720 Bytes

Versions: 12

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Api
    describe QueriesController, type: :controller do
      routes { Decidim::Api::Engine.routes }

      let!(:participatory_process) { create(:participatory_process) }
      let!(:other_participatory_process) { create(:participatory_process) }

      before do
        @request.env["decidim.current_organization"] = participatory_process.organization
      end

      it "executes a query" do
        post :create, params: { query: "{ processes { id }}" }

        parsed_response = JSON.parse(response.body)["data"]
        expect(parsed_response["processes"]).to eq(["id" => participatory_process.id.to_s])
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.7 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.6 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.5 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.4 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.3 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.2 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.1 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.6.0 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.5.1 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.5.0 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.4.4 decidim-api/spec/controllers/queries_controller_spec.rb