Sha256: a4057e044d8b1faf5016fcc8d870dad572232a4066015ca7c333e17f42056d17

Contents?: true

Size: 810 Bytes

Versions: 2

Compression:

Stored size: 810 Bytes

Contents

require "spec_helper"

describe Arrthorizer::Privilege do
  subject(:privilege) { Arrthorizer::Privilege.new(name: "some privilege") }

  let(:role) { Namespaced::ContextRole }
  let(:other_role) { UnnamespacedContextRole }

  describe :accessible_to? do
    context "when a Role was configured to have access to this privilege" do
      before :each do
        privilege.make_accessible_to(role)
      end

      context "and that Role is provided" do
        let(:arg) { role }

        it "returns true" do
          expect(privilege.accessible_to?(arg)).to be_true
        end
      end

      context "and the name of that Role is provided" do
        let(:arg) { role.name }

        it "returns true" do
          expect(privilege.accessible_to?(arg)).to be_true
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arrthorizer-0.1.0.pre2 spec/privilege/accessible_to_spec.rb
arrthorizer-0.1.0.pre spec/privilege/accessible_to_spec.rb