Sha256: 9b2a3a6d4e8ab39ec240e9dbb8f566e2f5311779642eebd026cda1e8779c53bf
Contents?: true
Size: 643 Bytes
Versions: 5
Compression:
Stored size: 643 Bytes
Contents
require "rails_helper" module Scram describe Scram::Policy do it "prioritizes targets" do policy = Policy.new policy.context = TestModel.name # Create a target that doesn't let us woot target1 = Target.new target1.actions << "woot" target1.allow = false # Create an even more important target that lets us woot target2 = Target.new target2.actions << "woot" target2.allow = true target2.priority = 1 policy.targets << target1 policy.targets << target2 policy.save expect(policy.can? nil, :woot, TestModel.new).to be :allow end end end
Version data entries
5 entries across 5 versions & 1 rubygems