Sha256: c47cdfc7b26a91c0e8dc94834baf592d907fd32f603277e91b361cc4faa9341c

Contents?: true

Size: 850 Bytes

Versions: 4

Compression:

Stored size: 850 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Admin
    describe ParticipatoryProcessesController, type: :controller do
      let(:organization) { create(:organization) }
      let!(:external_process) { create :participatory_process }

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

      describe "GET show" do
        context "process in another organization" do
          let(:user) { create(:user, :admin, :confirmed, organization: organization) }

          before do
            sign_in user, scope: :user
          end

          it "is not visible to the user" do
            expect do
              get :show, params: { id: external_process.id }
            end.to raise_error(ActiveRecord::RecordNotFound)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-0.3.2 decidim-admin/spec/controllers/participatory_processes_controller_spec.rb
decidim-0.3.1 decidim-admin/spec/controllers/participatory_processes_controller_spec.rb
decidim-0.3.0 decidim-admin/spec/controllers/participatory_processes_controller_spec.rb
decidim-0.2.0 decidim-admin/spec/controllers/participatory_processes_controller_spec.rb