aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorDarren <darren.chang@tarokosoftware.com>2018-08-13 14:06:49 +0800
committerDarren <darren.chang@tarokosoftware.com>2018-08-13 14:06:49 +0800
commit2efae0796a35d907b98e3609da8be8c4765b8aad (patch)
treee6209078a1e94db1aee0fd0d1a24a0ac8c9bf02d /guides/source
parentf2970a08b57ebcdb9cbf8eec5d10a7f04eb7b9d3 (diff)
downloadrails-2efae0796a35d907b98e3609da8be8c4765b8aad.tar.gz
rails-2efae0796a35d907b98e3609da8be8c4765b8aad.tar.bz2
rails-2efae0796a35d907b98e3609da8be8c4765b8aad.zip
Fix header setting doc in testing guide [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/testing.md5
1 files changed, 2 insertions, 3 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 01cda8e6e4..de93e1c653 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -1113,11 +1113,10 @@ end
Now you can try running all the tests and they should pass.
-NOTE: If you followed the steps in the Basic Authentication section, you'll need to add the following to the `setup` block to get all the tests passing:
+NOTE: If you followed the steps in the Basic Authentication section, you'll need to add authorization to every request header to get all the tests passing:
```ruby
-request.headers['Authorization'] = ActionController::HttpAuthentication::Basic.
- encode_credentials('dhh', 'secret')
+post articles_url, params: { article: { body: 'Rails is awesome!', title: 'Hello Rails' } }, headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials('dhh', 'secret') }
```
### Available Request Types for Functional Tests