Sha256: a185c8f7c0c1abddaa74aa3aaa61f5a283a863f5fff8e2de2568a5c874b2fefe

Contents?: true

Size: 922 Bytes

Versions: 82

Compression:

Stored size: 922 Bytes

Contents

module Ddr::Auth
  module Roles
    RSpec.describe PropertyRoleSet, roles: true do

      subject { described_class.new(wrapped) }
      
      let(:wrapped_class) do
        Class.new(ActiveTriples::Resource) do
          property :role, predicate: Ddr::Vocab::Roles.hasRole
        end
      end

      let(:wrapped) { wrapped_class.new.role }

      it_behaves_like "a role set"

      describe "equality" do
        let(:role1) { FactoryGirl.build(:role, :curator, :person, :policy) }
        let(:role2) { FactoryGirl.build(:role, :editor, :group, :resource) }        
        let(:other) { described_class.new(wrapped_class.new.role) }
        before do
          subject.grant role1, role2
          other.grant role2, role1
        end
        it "should be equal to another role set if it has the same roles, regardless of order" do
          expect(subject).to eq(other)
        end
      end

    end
  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
ddr-models-2.11.0 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.10.2 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.10.1 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.10.0 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.10.0.rc2 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.10.0.rc1 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.9.2 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.9.1 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.9.0 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.9.0.rc1 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.8.0 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.8.0.rc1 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.6 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.5 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.4 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.3 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.2 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.1 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.0 spec/auth/roles/property_role_set_spec.rb
ddr-models-2.7.0.rc1 spec/auth/roles/property_role_set_spec.rb