Sha256: 72ee65d555aa28bb221f535d04f1da2d8594335fd623ad81d8a66e992c289bd7

Contents?: true

Size: 563 Bytes

Versions: 3

Compression:

Stored size: 563 Bytes

Contents

require 'cgi'

describe "CGI::QueryExtension#accept_charset" 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_CHARSET']" do
    old_value, ENV['HTTP_ACCEPT_CHARSET'] = ENV['HTTP_ACCEPT_CHARSET'], "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
    begin
      @cgi.accept_charset.should == "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
    ensure
      ENV['HTTP_ACCEPT_CHARSET'] = old_value
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-cgi-1.0.0 spec/queryextension/accept_charset_spec.rb
rubysl-cgi-2.0.1 spec/queryextension/accept_charset_spec.rb
rubysl-cgi-2.0.0 spec/queryextension/accept_charset_spec.rb