mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
- update documentation
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
aee043de5a
commit
cec6f3fe20
1 changed files with 9 additions and 0 deletions
|
@ -168,6 +168,15 @@ module ActiveResource
|
|||
#
|
||||
# ActiveResource::HttpMock.respond_to(pairs, false)
|
||||
# ActiveResource::HttpMock.responses.length #=> 2
|
||||
#
|
||||
# # If you add a response with an existing request, it will be replaced
|
||||
#
|
||||
# fail_response = ActiveResource::Response.new("", 404, {})
|
||||
# pairs = {get_matz => fail_response}
|
||||
#
|
||||
# ActiveResource::HttpMock.respond_to(pairs, false)
|
||||
# ActiveResource::HttpMock.responses.length #=> 2
|
||||
#
|
||||
def respond_to(*args) #:yields: mock
|
||||
pairs = args.first || {}
|
||||
reset! if args.last.class != FalseClass
|
||||
|
|
Loading…
Reference in a new issue