From 00a4af9ab7e2008fe4e1a0cb1f31109a231d7279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strza=C5=82kowski?= Date: Thu, 13 Feb 2014 18:05:55 +0100 Subject: Check if variant array contains only symbols --- actionpack/test/dispatch/request_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/dispatch') 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 -- cgit v1.2.3