Sha256: 993ae24076c35c9bebfb354ad2bf0f83f5ce92bd5fcf26f69995e35a40d871f7
Contents?: true
Size: 954 Bytes
Versions: 11
Compression:
Stored size: 954 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe Decidim::ParticipatoryProcessesWithUserRole do let!(:organization_process) { create :participatory_process, organization: user.organization } let!(:external_process) { create :participatory_process } subject { described_class.new(user, :admin) } context "when the user is an admin" do let(:user) { create :user, :admin } it "returns only the organization processes" do expect(subject.query).to eq [organization_process] end end context "when the user is not an admin" do let(:user) { create :user } let!(:unmanageable_process) { create :participatory_process, organization: user.organization } before do create :participatory_process_user_role, user: user, participatory_process: organization_process end it "returns the processes the user can admin" do expect(subject.query).to eq [organization_process] end end end
Version data entries
11 entries across 11 versions & 1 rubygems