aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/filters_test.rb
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2015-07-17 21:48:00 -0400
committerPrem Sichanugrist <s@sikac.hu>2015-07-17 22:27:33 -0400
commit8cb8ce98d903929342e2ca3a54a07ab5196baf93 (patch)
treedeae317ebeca2cb20b57e9ad9a8c0c36720c8d7f /actionpack/test/controller/filters_test.rb
parent0db98b3ec8226042a5c3400d594d803abb5b169f (diff)
downloadrails-8cb8ce98d903929342e2ca3a54a07ab5196baf93.tar.gz
rails-8cb8ce98d903929342e2ca3a54a07ab5196baf93.tar.bz2
rails-8cb8ce98d903929342e2ca3a54a07ab5196baf93.zip
Stop using deprecated `render :text` in test
This will silence deprecation warnings. Most of the test can be changed from `render :text` to render `:plain` or `render :body` right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from `render :body`.
Diffstat (limited to 'actionpack/test/controller/filters_test.rb')
-rw-r--r--actionpack/test/controller/filters_test.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index 958097b56d..08271012e9 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -40,7 +40,7 @@ class FilterTest < ActionController::TestCase
before_action :ensure_login, :except => [:go_wild]
def go_wild
- render :text => "gobble"
+ render plain: "gobble"
end
end
@@ -51,7 +51,7 @@ class FilterTest < ActionController::TestCase
(1..3).each do |i|
define_method "fail_#{i}" do
- render :text => i.to_s
+ render plain: i.to_s
end
end
@@ -222,7 +222,7 @@ class FilterTest < ActionController::TestCase
skip_before_action :clean_up_tmp, only: :login, if: -> { true }
def login
- render text: 'ok'
+ render plain: 'ok'
end
end
@@ -234,7 +234,7 @@ class FilterTest < ActionController::TestCase
skip_before_action :clean_up_tmp, if: -> { true }, except: :login
def login
- render text: 'ok'
+ render plain: 'ok'
end
end
@@ -258,11 +258,11 @@ class FilterTest < ActionController::TestCase
before_action :ensure_login, :only => :index
def index
- render :text => 'ok'
+ render plain: 'ok'
end
def public
- render :text => 'ok'
+ render plain: 'ok'
end
end
@@ -272,7 +272,7 @@ class FilterTest < ActionController::TestCase
before_action :ensure_login
def index
- render :text => 'ok'
+ render plain: 'ok'
end
private
@@ -383,7 +383,7 @@ class FilterTest < ActionController::TestCase
before_action(AuditFilter)
def show
- render :text => "hello"
+ render plain: "hello"
end
end
@@ -421,11 +421,11 @@ class FilterTest < ActionController::TestCase
before_action :second, :only => :foo
def foo
- render :text => 'foo'
+ render plain: 'foo'
end
def bar
- render :text => 'bar'
+ render plain: 'bar'
end
protected
@@ -442,7 +442,7 @@ class FilterTest < ActionController::TestCase
before_action :choose
%w(foo bar baz).each do |action|
- define_method(action) { render :text => action }
+ define_method(action) { render plain: action }
end
private
@@ -471,7 +471,7 @@ class FilterTest < ActionController::TestCase
@ran_filter << 'between_before_all_and_after_all'
end
def show
- render :text => 'hello'
+ render plain: 'hello'
end
end
@@ -481,7 +481,7 @@ class FilterTest < ActionController::TestCase
def around(controller)
yield
rescue ErrorToRescue => ex
- controller.__send__ :render, :text => "I rescued this: #{ex.inspect}"
+ controller.__send__ :render, plain: "I rescued this: #{ex.inspect}"
end
end