diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2016-07-10 10:58:39 +0000 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2016-07-10 10:58:39 +0000 |
commit | b76808602de772fecae4bd27298f7662aac8436a (patch) | |
tree | 0e623939c2432e30449aeb8acc70a1ea0d42ded9 | |
parent | 777ff90ab5da3a7cf8522231270b50c4b29fb15f (diff) | |
parent | 32426cec270142177dafccef6359465c7322e4b6 (diff) | |
download | rails-b76808602de772fecae4bd27298f7662aac8436a.tar.gz rails-b76808602de772fecae4bd27298f7662aac8436a.tar.bz2 rails-b76808602de772fecae4bd27298f7662aac8436a.zip |
Merge branch 'master' of github.com:rails/docrails
-rw-r--r-- | guides/source/action_view_overview.md | 2 | ||||
-rw-r--r-- | guides/source/configuring.md | 4 | ||||
-rw-r--r-- | guides/source/testing.md | 15 |
3 files changed, 18 insertions, 3 deletions
diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index f68abbae3c..e11466e79f 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -1439,7 +1439,7 @@ Formats a number with the specified level of `precision`, which defaults to 3. ```ruby number_with_precision(111.2345) # => 111.235 -number_with_precision(111.2345, 2) # => 111.23 +number_with_precision(111.2345, precision: 2) # => 111.23 ``` ### SanitizeHelper diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 4332dd68c9..34878e5c38 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -297,7 +297,9 @@ All these configuration options are delegated to the `I18n` library. * Or you can set different fallbacks for locales individually. For example, if you want to use `:tr` for `:az` and `:de`, `:en` for `:da` as fallbacks, you can do it, like so: ```ruby - config.i18n.fallbacks = { az: :tr, da: [:de, :en] } + config.i18n.fallbacks = { az: :tr, da: [:de, :en] } + #or + config.i18n.fallbacks.map = { az: :tr, da: [:de, :en] } ``` ### Configuring Active Record diff --git a/guides/source/testing.md b/guides/source/testing.md index e8dc6ffe2a..440d87bf73 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -851,12 +851,25 @@ cookies["are_good_for_u"] cookies[:are_good_for_u] ### Instance Variables Available -You also have access to three instance variables in your functional tests: +You also have access to three instance variables in your functional tests, after a request is made: * `@controller` - The controller processing the request * `@request` - The request object * `@response` - The response object + +```ruby +class ArticlesControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get articles_url + + assert_equal "index", @controller.action_name + assert_equal "application/x-www-form-urlencoded", @request.media_type + assert_match "Articles", @response.body + end +end +``` + ### Setting Headers and CGI variables [HTTP headers](http://tools.ietf.org/search/rfc2616#section-5.3) |