Sha256: 7cde18719e9a03528e3e24ded02e1753899c3659a0387b92fd1c5e9773fbed44

Contents?: true

Size: 673 Bytes

Versions: 11

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

module Decidim
  module Api
    describe QueriesController, type: :controller do
      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

11 entries across 11 versions & 1 rubygems

Version Path
decidim-0.1.0 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.8.1 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.7 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.6 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.5 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.4 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.3 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.2 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.1 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.1.alpha9 decidim-api/spec/controllers/queries_controller_spec.rb
decidim-0.0.1.alpha8 decidim-api/spec/controllers/queries_controller_spec.rb