aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--guides/source/action_view_overview.md2
-rw-r--r--guides/source/configuring.md4
-rw-r--r--guides/source/testing.md15
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)