aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/required_params_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/required_params_test.rb')
-rw-r--r--actionpack/test/controller/required_params_test.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/test/controller/required_params_test.rb b/actionpack/test/controller/required_params_test.rb
index b6efcd6f9a..c9b0ac874d 100644
--- a/actionpack/test/controller/required_params_test.rb
+++ b/actionpack/test/controller/required_params_test.rb
@@ -1,4 +1,4 @@
-require 'abstract_unit'
+require "abstract_unit"
class BooksController < ActionController::Base
def create
@@ -32,7 +32,6 @@ class ActionControllerRequiredParamsTest < ActionController::TestCase
end
class ParametersRequireTest < ActiveSupport::TestCase
-
test "required parameters should accept and return false value" do
assert_equal(false, ActionController::Parameters.new(person: false).require(:person))
end
@@ -50,17 +49,17 @@ class ParametersRequireTest < ActiveSupport::TestCase
end
test "require array when all required params are present" do
- safe_params = ActionController::Parameters.new(person: {first_name: 'Gaurish', title: 'Mjallo', city: 'Barcelona'})
+ safe_params = ActionController::Parameters.new(person: {first_name: "Gaurish", title: "Mjallo", city: "Barcelona"})
.require(:person)
.require([:first_name, :title])
assert_kind_of Array, safe_params
- assert_equal ['Gaurish', 'Mjallo'], safe_params
+ assert_equal ["Gaurish", "Mjallo"], safe_params
end
test "require array when a required param is missing" do
assert_raises(ActionController::ParameterMissing) do
- ActionController::Parameters.new(person: {first_name: 'Gaurish', title: nil})
+ ActionController::Parameters.new(person: {first_name: "Gaurish", title: nil})
.require(:person)
.require([:first_name, :title])
end
@@ -75,7 +74,7 @@ class ParametersRequireTest < ActiveSupport::TestCase
test "Deprecated methods are deprecated" do
assert_deprecated do
- ActionController::Parameters.new(foo: "bar").merge!({bar: "foo"})
+ ActionController::Parameters.new(foo: "bar").merge!(bar: "foo")
end
end
end