diff options
author | John Gallagher <john@synapticmishap.co.uk> | 2012-10-27 21:55:56 +0100 |
---|---|---|
committer | John Gallagher <john@synapticmishap.co.uk> | 2012-10-27 21:55:56 +0100 |
commit | 4edea9e82087f5a331a277ee4bf7b01256d11be0 (patch) | |
tree | 58164e6aa6ac19a644e590dc35d3ab98fc5a42ef /actionpack/lib/action_controller/test_case.rb | |
parent | c570ba70fe6ed53fd1ac5f30f0c9ba4cb7cd4796 (diff) | |
parent | 62f273b6501db72e3c902d947e6828dcab9c004a (diff) | |
download | rails-4edea9e82087f5a331a277ee4bf7b01256d11be0.tar.gz rails-4edea9e82087f5a331a277ee4bf7b01256d11be0.tar.bz2 rails-4edea9e82087f5a331a277ee4bf7b01256d11be0.zip |
Merge branch 'master' of https://github.com/lifo/docrails
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index d911d47a1d..d007133183 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -61,25 +61,25 @@ module ActionController # assert_template %r{\Aadmin/posts/new\Z} # # # assert that the layout 'admin' was rendered - # assert_template :layout => 'admin' - # assert_template :layout => 'layouts/admin' - # assert_template :layout => :admin + # assert_template layout: 'admin' + # assert_template layout: 'layouts/admin' + # assert_template layout: :admin # # # assert that no layout was rendered - # assert_template :layout => nil - # assert_template :layout => false + # assert_template layout: nil + # assert_template layout: false # # # assert that the "_customer" partial was rendered twice - # assert_template :partial => '_customer', :count => 2 + # assert_template partial: '_customer', count: 2 # # # assert that no partials were rendered - # assert_template :partial => false + # assert_template partial: false # # In a view test case, you can also assert that specific locals are passed # to partials: # # # assert that the "_customer" partial was rendered with a specific object - # assert_template :partial => '_customer', :locals => { :customer => @customer } + # assert_template partial: '_customer', locals: { customer: @customer } def assert_template(options = {}, message = nil) # Force body to be read in case the # template is being streamed @@ -267,7 +267,7 @@ module ActionController # class BooksControllerTest < ActionController::TestCase # def test_create # # Simulate a POST response with the given HTTP parameters. - # post(:create, :book => { :title => "Love Hina" }) + # post(:create, book: { title: "Love Hina" }) # # # Assert that the controller tried to redirect us to # # the created book's URI. @@ -281,7 +281,7 @@ module ActionController # You can also send a real document in the simulated HTTP request. # # def test_create - # json = {:book => { :title => "Love Hina" }}.to_json + # json = {book: { title: "Love Hina" }}.to_json # post :create, json # end # @@ -356,7 +356,7 @@ module ActionController # # If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case. # - # assert_redirected_to page_url(:title => 'foo') + # assert_redirected_to page_url(title: 'foo') class TestCase < ActiveSupport::TestCase # Use AC::TestCase for the base class when describing a controller |