diff options
author | Kir Shatrov <shatrov@me.com> | 2015-03-31 14:36:26 +0300 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2015-03-31 14:38:28 +0300 |
commit | 487aa51b1414d3f316c7ccdc92af2f212961e0bb (patch) | |
tree | 64fa25d2046ed7f099d7eab97a6184d6bc0a9832 | |
parent | 65200a38b91021beabbd09d8c56ddabe68cea1f1 (diff) | |
download | rails-487aa51b1414d3f316c7ccdc92af2f212961e0bb.tar.gz rails-487aa51b1414d3f316c7ccdc92af2f212961e0bb.tar.bz2 rails-487aa51b1414d3f316c7ccdc92af2f212961e0bb.zip |
Suggest new hash syntax in testing guide
-rw-r--r-- | guides/source/testing.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md index df61c61aa3..a67f2edbaa 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -496,13 +496,13 @@ All the keyword arguments are optional. Example: Calling the `:show` action, passing an `id` of 12 as the `params` and setting a `user_id` of 5 in the session: ```ruby -get(:show, params: { 'id' => "12" }, session: { 'user_id' => 5 }) +get(:show, params: { id: 12 }, session: { user_id: 5 }) ``` Another example: Calling the `:view` action, passing an `id` of 12 as the `params`, this time with no session, but with a flash message. ```ruby -get(:view, params: { 'id' => '12' }, flash: { 'message' => 'booya!' }) +get(:view, params: { id: 12 }, flash: { message: 'booya!' }) ``` NOTE: If you try running `test_should_create_article` test from `articles_controller_test.rb` it will fail on account of the newly added model level validation and rightly so. |