diff options
Diffstat (limited to 'spec/rubyspec/library/cgi/queryextension/accept_spec.rb')
-rw-r--r-- | spec/rubyspec/library/cgi/queryextension/accept_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/rubyspec/library/cgi/queryextension/accept_spec.rb b/spec/rubyspec/library/cgi/queryextension/accept_spec.rb new file mode 100644 index 0000000000..0c7aa2ab1f --- /dev/null +++ b/spec/rubyspec/library/cgi/queryextension/accept_spec.rb @@ -0,0 +1,22 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require 'cgi' + +describe "CGI::QueryExtension#accept" do + before :each do + ENV['REQUEST_METHOD'], @old_request_method = "GET", ENV['REQUEST_METHOD'] + @cgi = CGI.new + end + + after :each do + ENV['REQUEST_METHOD'] = @old_request_method + end + + it "returns ENV['HTTP_ACCEPT']" do + old_value, ENV['HTTP_ACCEPT'] = ENV['HTTP_ACCEPT'], "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + begin + @cgi.accept.should == "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" + ensure + ENV['HTTP_ACCEPT'] = old_value + end + end +end |