提交 2efae079 编写于 作者: D Darren

Fix header setting doc in testing guide [ci skip]

上级 f2970a08
...@@ -1113,11 +1113,10 @@ end ...@@ -1113,11 +1113,10 @@ end
Now you can try running all the tests and they should pass. 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 ```ruby
request.headers['Authorization'] = ActionController::HttpAuthentication::Basic. post articles_url, params: { article: { body: 'Rails is awesome!', title: 'Hello Rails' } }, headers: { Authorization: ActionController::HttpAuthentication::Basic.encode_credentials('dhh', 'secret') }
encode_credentials('dhh', 'secret')
``` ```
### Available Request Types for Functional Tests ### Available Request Types for Functional Tests
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册