aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2008-02-07 16:46:50 +0000
committerRick Olson <technoweenie@gmail.com>2008-02-07 16:46:50 +0000
commit8e6638afa4b9fe7a361c81e6d2ede77951b81aff (patch)
tree2214ef62e23185938434c226ce6da2185222b830 /actionpack/test
parent689e27567e2a248e262945c52266340d7385aeed (diff)
downloadrails-8e6638afa4b9fe7a361c81e6d2ede77951b81aff.tar.gz
rails-8e6638afa4b9fe7a361c81e6d2ede77951b81aff.tar.bz2
rails-8e6638afa4b9fe7a361c81e6d2ede77951b81aff.zip
Fix bug with setting Request#format= after the getter has cached the value. Closes #10889 [cch1]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/request_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb
index 520358f739..68d6afb426 100644
--- a/actionpack/test/controller/request_test.rb
+++ b/actionpack/test/controller/request_test.rb
@@ -371,6 +371,13 @@ class RequestTest < Test::Unit::TestCase
assert_equal Mime::HTML, @request.content_type
end
+ def test_format_assignment_should_set_format
+ @request.instance_eval { self.format = :txt }
+ assert !@request.format.xml?
+ @request.instance_eval { self.format = :xml }
+ assert @request.format.xml?
+ end
+
def test_content_no_type
assert_equal nil, @request.content_type
end