aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2014-02-13 18:05:55 +0100
committerŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2014-02-13 18:05:55 +0100
commit00a4af9ab7e2008fe4e1a0cb1f31109a231d7279 (patch)
tree69e72dc8168a55108b133506c51696cfa1466810 /actionpack/test/dispatch
parentf2dfa83fac5e892335d2bceaa6dfe344515fee26 (diff)
downloadrails-00a4af9ab7e2008fe4e1a0cb1f31109a231d7279.tar.gz
rails-00a4af9ab7e2008fe4e1a0cb1f31109a231d7279.tar.bz2
rails-00a4af9ab7e2008fe4e1a0cb1f31109a231d7279.zip
Check if variant array contains only symbols
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/request_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index df47520850..40e32cb4d3 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -852,6 +852,14 @@ class RequestTest < ActiveSupport::TestCase
request.variant = [:phone, :tablet]
assert_equal [:phone, :tablet], request.variant
+
+ assert_raise ArgumentError do
+ request.variant = [:phone, "tablet"]
+ end
+
+ assert_raise ArgumentError do
+ request.variant = "yolo"
+ end
end
test "setting variant with non symbol value" do