diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-08-14 07:37:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 07:37:19 +0900 |
commit | ffc4703f22888dce0394fe0ab524a9e6cdc3c7e5 (patch) | |
tree | e6209078a1e94db1aee0fd0d1a24a0ac8c9bf02d | |
parent | f2970a08b57ebcdb9cbf8eec5d10a7f04eb7b9d3 (diff) | |
parent | 2efae0796a35d907b98e3609da8be8c4765b8aad (diff) | |
download | rails-ffc4703f22888dce0394fe0ab524a9e6cdc3c7e5.tar.gz rails-ffc4703f22888dce0394fe0ab524a9e6cdc3c7e5.tar.bz2 rails-ffc4703f22888dce0394fe0ab524a9e6cdc3c7e5.zip |
Merge pull request #33602 from darren987469/fix-header-setting-doc-in-testing-guide
Fix header setting doc in testing guide [ci skip]
-rw-r--r-- | guides/source/testing.md | 5 |
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 |