aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Moss <maclover7@users.noreply.github.com>2016-11-28 19:53:00 -0500
committerGitHub <noreply@github.com>2016-11-28 19:53:00 -0500
commit67389eb1a08f00be7926efe0629118b5680ebc4c (patch)
treeea122bf64396a659442b3a5f8f52fb330321cdcd
parent06d20496186249a72ba40404d7a3425fd3eeb5c9 (diff)
parenta92e115e1925034d3cae6b7c173a4a12e810e667 (diff)
downloadrails-67389eb1a08f00be7926efe0629118b5680ebc4c.tar.gz
rails-67389eb1a08f00be7926efe0629118b5680ebc4c.tar.bz2
rails-67389eb1a08f00be7926efe0629118b5680ebc4c.zip
Merge pull request #27204 from JessRudder/22862-auth-note-on-tests
Add note about step needed to get tests to pass if you implemented basic auth [ci skip]
-rw-r--r--guides/source/testing.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index bc1f78fb2a..29a9537141 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -800,6 +800,13 @@ 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:
+
+```ruby
+request.headers['Authorization'] = ActionController::HttpAuthentication::Basic.
+ encode_credentials('dhh', 'secret')
+```
+
### Available Request Types for Functional Tests
If you're familiar with the HTTP protocol, you'll know that `get` is a type of request. There are 6 request types supported in Rails functional tests: