Skip to content

Commit

Permalink
Add #to_return_json to README
Browse files Browse the repository at this point in the history
  • Loading branch information
inkstak committed Dec 12, 2022
1 parent 347de69 commit 54a634e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@ stub_request(:any, "www.example.com").
Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
```

### Response with JSON body

```ruby

stub_request(:any, "www.example.com").
to_return_json(body: {foo: "bar"})

Net::HTTP.get('www.example.com', '/') # ===> "{\"foo\": \"bar\"}"
```

### Response with custom status message

```ruby
Expand Down

0 comments on commit 54a634e

Please sign in to comment.