Class: Reeve::Testing::Matchers::DenyAccessFor

Inherits:
Base
  • Object
show all
Defined in:
lib/reeve/testing/matchers/deny_access_for.rb

Overview

FR-016, from RSpec:

it { is_expected.to deny_access_for(stranger).with(query: "AC") }

Backed by CrossPrincipalLeak in its :nothing expectation — this principal may receive no record at all. A denial satisfies it; so does an allowed call that returns an empty scope, because from the agent's side those are the same thing, and FR-006 requires that they stay the same thing.

Instance Attribute Summary

Attributes inherited from Base

#result

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#failure_message, #failure_message_when_negated, #invoked_by, #matches?, #reading, #supports_block_expectations?, #with

Constructor Details

#initialize(principal) ⇒ DenyAccessFor

Returns a new instance of DenyAccessFor.



19
20
21
22
# File 'lib/reeve/testing/matchers/deny_access_for.rb', line 19

def initialize(principal)
  super()
  @principal = principal
end

Class Method Details

.checkObject



15
16
17
# File 'lib/reeve/testing/matchers/deny_access_for.rb', line 15

def self.check
  Checks::CrossPrincipalLeak
end

Instance Method Details

#descriptionObject



24
25
26
# File 'lib/reeve/testing/matchers/deny_access_for.rb', line 24

def description
  "deny access for #{@principal.inspect}"
end