lib/ocean-rails.rb
#
# For stubbing failed authorisation calls. Makes <tt>Api.permitted?</tt> return the
# given status and a body containing a standard API error with the given error messages.
#
For stubbing failed authorisation calls. Makes Api.permitted? return the
given status and a body containing a standard API error with the given error messages.
For stubbing failed authorisation calls . Makes Api . permitted? return the given status and a body containing a standard API error with the given error messages .
def deny_with(status, *error_messages)
  allow(Api).to receive(:permitted?).
    and_return(double(:status => status, 
                      :body => {'_api_error' => error_messages}))
end
def deny_with ( status , * error_messages ) allow ( Api ) . to receive ( :permitted? ) . and_return ( double ( :status => status , :body => { '_api_error' => error_messages } ) ) end
For stubbing failed authorisation calls.
For stubbing failed authorisation calls .
status
error_messages