Sha256: 653aea95af56e6d2389157efc1e3f131f2ebc3f9d0ee2262f57158b05bf64caa

Contents?: true

Size: 809 Bytes

Versions: 6

Compression:

Stored size: 809 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')

describe "images" do

  include Rack::Test::Methods

  def app
    Mercury
  end

  it "should return gif" do
    File.stub!(:open).and_return('foobar')
    get "/hello.gif"
    puts last_response.body.should == 'foobar'
  end
  
  it "should return correct file content type for gif" do
    app.get_image_type('/hello.gif').should == "image/gif"
  end

  it "should return correct file content type for jpg" do
    app.get_image_type('/hello.jpg').should == "image/jpg"
  end

  it "should return correct file content type for png" do
    app.get_image_type('/hello.png').should == "image/png"
  end

  it "should return correct file content type for jpeg" do
    app.get_image_type('/hello.jpeg').should == "image/jpeg"
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mercury-0.9.9 spec/lib/mercury/images_spec.rb
mercury-0.9.8 spec/lib/mercury/images_spec.rb
mercury-0.9.7 spec/lib/mercury/images_spec.rb
mercury-0.9.6 spec/lib/mercury/images_spec.rb
mercury-0.9.5 spec/lib/mercury/images_spec.rb
mercury-0.9.4 spec/lib/mercury/images_spec.rb