Module: Trailblazer::Test::Operation::PolicyAssertions

Includes:
Assertions
Defined in:
lib/trailblazer/test/operation/policy_assertions.rb

Instance Method Summary collapse

Methods included from Assertions

#_assert_call, #_call_operation, #_model, #assert_fail, #assert_fail_with_model, #assert_pass, #assert_pass_with_model, #ctx, #merge_for, #params

Instance Method Details

#assert_policy_fail(operation_class, ctx, policy_name: "default") ⇒ Object



6
7
8
9
10
11
# File 'lib/trailblazer/test/operation/policy_assertions.rb', line 6

def assert_policy_fail(operation_class, ctx, policy_name: "default")
  _assert_call(operation_class, ctx, user_block: nil) do |result|
    assert_equal true, result.failure?
    assert_equal true, result["result.policy.#{policy_name}"].failure?
  end
end