Sha256: caf2b7ea965fa619be67671666c60f1beca7a7ac2a9575433c15e2fc11591f43

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

require "spec_helper"

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

    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 = Namespaced::ContextRole

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

Version data entries

2 entries across 2 versions & 1 rubygems

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