aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorKir Shatrov <shatrov@me.com>2015-02-01 16:07:42 +0300
committerKir Shatrov <shatrov@me.com>2015-02-01 16:07:42 +0300
commitb19999f3a7c39fc1a959cc3c39575014d0fd2835 (patch)
tree30eca90db38b5744671b15b24e267fba589aa314 /guides
parent33030ea7cbfa026b0f9f95a2c5d2dd363a7fe6aa (diff)
downloadrails-b19999f3a7c39fc1a959cc3c39575014d0fd2835.tar.gz
rails-b19999f3a7c39fc1a959cc3c39575014d0fd2835.tar.bz2
rails-b19999f3a7c39fc1a959cc3c39575014d0fd2835.zip
Migrating xhr methods to keyword arguments syntax
in `ActionController::TestCase` and `ActionDispatch::Integration` Old syntax: `xhr :get, :create, params: { id: 1 }` New syntax example: `get :create, params: { id: 1 }, xhr: true`
Diffstat (limited to 'guides')
-rw-r--r--guides/source/testing.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index a083b3f981..7345c7f522 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -537,11 +537,11 @@ NOTE: Functional tests do not verify whether the specified request type is accep
### Testing XHR (AJAX) requests
-`xhr` accepts method (listed in the section above), action name and parameters:
+Enable set `xhr: true` option as an argument to `get/post/patch/put/delete` method:
```ruby
test "ajax request responds with no layout" do
- xhr :get, :show, params: { id: articles(:first).id }
+ get :show, params: { id: articles(:first).id }, xhr: true
assert_template :index
assert_template layout: nil