Sha256: be4b54149d1cfac3159e00f48318e31a127d49c2e5e321e62c2f86e23320cdd4

Contents?: true

Size: 653 Bytes

Versions: 8

Compression:

Stored size: 653 Bytes

Contents

require "spec_helper"

describe Arrthorizer::Privilege do
  describe :make_accessible_to do
    let(:privilege) { Arrthorizer::Privilege.new(name: "privilege") }
    let(:role) { SomeGroup }

    it "makes the privilege accessible to the role" do
      expect {
        privilege.make_accessible_to(role)
      }.to change { privilege.accessible_to?(role) }.to(true)
    end

    it "does not make it accessible to a different role" do
      unrelated_role = Arrthorizer::Group.new("unrelated role")

      expect {
        privilege.make_accessible_to(role)
      }.not_to change { privilege.accessible_to?(unrelated_role) }.to(true)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
arrthorizer-0.3.1 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.3.0 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.2.1 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.2.0 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.1.3 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.1.2 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.1.1 spec/privilege/make_accessible_to_spec.rb
arrthorizer-0.1.0 spec/privilege/make_accessible_to_spec.rb