Sha256: 8d5517ff22ab7ed6986cbbe36cf50a9aba67f37232c7fc264fcdab5524202214

Contents?: true

Size: 918 Bytes

Versions: 11

Compression:

Stored size: 918 Bytes

Contents

require File.join(File.dirname(__FILE__), "../..", "test_helper.rb")
require 'relevance/core_extensions/file'

describe "Relevance::CoreExtensions::Response#html?" do
  before do
    @response = OpenStruct.new
    @response.extend(Relevance::CoreExtensions::Response)
  end         
  
  it "should be html if the content-type is 'text/html'" do
    @response.content_type = "text/html"
    @response.should.be.html
    @response.content_type = "text/html;charset=iso-8859-2"
    @response.should.be.html
  end

  it "should not be html if the content-type isn't an html type" do
    @response.content_type = "text/plain"
    @response.should.not.be.html
  end

  # better ideas welcome, but be careful not to  
  # castrate tarantula for proxies that don't set the content-type
  it "should pretend we have html if the content-type is nil" do
    @response.content_type = nil
    @response.should.be.html
  end
  
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
relevance-tarantula-0.0.1 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.2 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.3 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.5 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.6 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.7.1 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.7 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.8.0 test/relevance/core_extensions/response_test.rb
relevance-tarantula-0.0.8.1 test/relevance/core_extensions/response_test.rb
tarantula-0.0.5 test/relevance/core_extensions/response_test.rb
tarantula-0.0.8.1 test/relevance/core_extensions/response_test.rb