Sha256: e45f5b66cc9f2240f4a3575828ba7f4513155380e6d5f0fa07bfa759641ed1b0

Contents?: true

Size: 625 Bytes

Versions: 5

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Decidim::Comments::Abilities::ProcessAdminUser do
  let(:user) { build(:user) }
  let(:user_process) { create :participatory_process, organization: user.organization }
  let(:context) { {} }

  subject { described_class.new(user, context) }

  context "when the user is an admin" do
    let(:user) { build(:user, :admin) }

    it "doesn't have any permission" do
      expect(subject.permissions[:can]).to be_empty
      expect(subject.permissions[:cannot]).to be_empty
    end
  end

  it { is_expected.to be_able_to(:manage, Decidim::Comments::Comment) }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-0.4.0 decidim-comments/spec/models/abilities/process_admin_user_spec.rb
decidim-0.3.2 decidim-comments/spec/models/abilities/process_admin_user_spec.rb
decidim-0.3.1 decidim-comments/spec/models/abilities/process_admin_user_spec.rb
decidim-0.3.0 decidim-comments/spec/models/abilities/process_admin_user_spec.rb
decidim-0.2.0 decidim-comments/spec/models/abilities/process_admin_user_spec.rb