Sha256: b1edb3dffca4b2201f9b9132451f99d01f491361c71a43977f67d6f577e184f0

Contents?: true

Size: 622 Bytes

Versions: 66

Compression:

Stored size: 622 Bytes

Contents

require 'spec_helper'
require 'cancan/matchers'

describe "Ability on embargos and leases" do
  subject { Ability.new(current_user) }

  let(:current_user) { create(:user) }

  describe "a regular user" do
    it do
      should_not be_able_to :index, Hydra::AccessControls::Embargo
      should_not be_able_to :index, Hydra::AccessControls::Lease
    end
  end

  describe "an admin user" do
    before { allow(current_user).to receive(:groups).and_return(['admin']) }
    it do
      should be_able_to :index, Hydra::AccessControls::Embargo
      should be_able_to :index, Hydra::AccessControls::Lease
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.7 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-2.0.0 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-2.0.0.rc2 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.6 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.5 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.4 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.3 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.2 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-2.0.0.rc1 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.1 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.0 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.7.0.beta1 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.6.3 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.6.2 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.6.1 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.6.0 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.5.0 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.4.0 spec/abilities/embargo_and_lease_ability_spec.rb
curation_concerns-1.3.3 spec/abilities/embargo_and_lease_ability_spec.rb