Sha256: ff38d7b6b8010d6a7b890953add4c12bef58fe644ce38ac582404c1729af8537
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
shared_examples 'Unidom::Authorization::Concerns::AsAuthorized' do |model_attributes, permission, authorizer| context do authorizing_1_attribtues = { permission_id: SecureRandom.uuid, authorizer_id: SecureRandom.uuid, authorizer_type: 'Unidom::Authorization::Authorizer::Mock' } authorizing_2_attribtues = { permission_id: SecureRandom.uuid, authorizer_id: SecureRandom.uuid, authorizer_type: 'Unidom::Authorization::Authorizer::Mock' } it_behaves_like 'has_many', model_attributes, :authorizings, Unidom::Authorization::Authorizing, [ authorizing_1_attribtues, authorizing_2_attribtues ] authorized = described_class.create! model_attributes it_behaves_like 'assert_present!', authorized, :is_authorized!, [ { permission: permission, by: authorizer, at: Time.now } ], [ :permission, :by, :at ] it_behaves_like 'assert_present!', authorized, :is_authorized?, [ { permission: permission, at: Time.now } ], [ :permission, :at ] it_behaves_like 'assert_present!', authorized, :is_prohibited!, [ { permission: permission, at: Time.now } ], [ :permission, :at ] end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
unidom-authorization-1.6.6 | lib/rspec/models/unidom/authorization/concerns/as_authorized_shared_examples.rb |