diff options
author | Xavier Noria <fxn@hashref.com> | 2013-09-07 01:33:19 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-09-07 01:33:19 -0700 |
commit | c989a18a74d970be86c537766f14916bd06fe176 (patch) | |
tree | cf2ab71e426364c6b82e884b00146acf1345abc1 /guides/source/testing.md | |
parent | 6a91a3307ff6556225ab8717617074cea20222e0 (diff) | |
parent | 2c8bc2cdcdb7b144b7a583d24922fd8064bcff3d (diff) | |
download | rails-c989a18a74d970be86c537766f14916bd06fe176.tar.gz rails-c989a18a74d970be86c537766f14916bd06fe176.tar.bz2 rails-c989a18a74d970be86c537766f14916bd06fe176.zip |
Merge pull request #12155 from jetthoughts/reformat_guides_code_examples
Use Ruby on Rails Coding Conventions for code examples in the guides
Diffstat (limited to 'guides/source/testing.md')
-rw-r--r-- | guides/source/testing.md | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md index 1b0a0abf9a..5b8829b89a 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -757,24 +757,24 @@ class UserFlowsTest < ActionDispatch::IntegrationTest private - module CustomDsl - def browses_site - get "/products/all" - assert_response :success - assert assigns(:products) + module CustomDsl + def browses_site + get "/products/all" + assert_response :success + assert assigns(:products) + end end - end - def login(user) - open_session do |sess| - sess.extend(CustomDsl) - u = users(user) - sess.https! - sess.post "/login", username: u.username, password: u.password - assert_equal '/welcome', path - sess.https!(false) + def login(user) + open_session do |sess| + sess.extend(CustomDsl) + u = users(user) + sess.https! + sess.post "/login", username: u.username, password: u.password + assert_equal '/welcome', path + sess.https!(false) + end end - end end ``` @@ -887,10 +887,9 @@ class PostsControllerTest < ActionController::TestCase private - def initialize_post - @post = posts(:one) - end - + def initialize_post + @post = posts(:one) + end end ``` |