Module: Cuprum::Rails::RSpec::Contracts::Actions::NewContracts::ShouldBeANewActionContract
- Extended by:
- RSpec::SleepingKingStudios::Contract
- Defined in:
- lib/cuprum/rails/rspec/contracts/actions/new_contracts.rb
Overview
Contract asserting the action implements the new action interface.
Instance Method Summary collapse
-
#apply(example_group, **options) { ... } ⇒ Object
Adds the contract to the example group.
Instance Method Details
#apply(example_group, **options) { ... } ⇒ Object
Adds the contract to the example group.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/cuprum/rails/rspec/contracts/actions/new_contracts.rb', line 32 contract do |**, &block| include Cuprum::Rails::RSpec::Contracts::ActionContracts include Cuprum::Rails::RSpec::Contracts::Actions::NewContracts # :nocov: if [:examples_on_success] && block raise ArgumentError, 'provide either :examples_on_success or a block' elsif block [:examples_on_success] = block end # :nocov: include_contract 'should be a resource action' include_contract( 'should build the entity', expected_attributes: [:expected_attributes_on_success], expected_value: [:expected_value_on_success], &[:examples_on_success] ) end |