Method: Conduit::Core::Action::InstanceMethods#perform
- Defined in:
- lib/conduit/core/action.rb
#perform ⇒ Object
Entry method. Calls either the mocker or the ‘perform_request` method.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/conduit/core/action.rb', line 157 def perform # When testing we can mock the request. The mocker used # will depend on the action's name. For example: # `Conduit::MyDriver::RequestMocker::Activate` will be responsible for # mocking the `activate` action. # # * To mock success pass `mock_status: 'success'` as an option. # * To mock failure pass `mock_status: 'failure'` as an option. if mock_mode? mocker = request_mocker.new(self, ) mocker.with_mocking { perform_request } else perform_request end end |