Sha256: c49102e47bf873ccd6e88f2c7c6fe46ea7603b80c899b174160a95dc0d71215b

Contents?: true

Size: 804 Bytes

Versions: 12

Compression:

Stored size: 804 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"
    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

12 entries across 12 versions & 2 rubygems

Version Path
mars-0.2.0 spec/lib/mercury/images_spec.rb
mars-0.1.2 spec/lib/mercury/images_spec.rb
mars-0.1.0 spec/lib/mercury/images_spec.rb
mercury-1.0.2 spec/lib/mercury/images_spec.rb
mercury-1.0.1 spec/lib/mercury/images_spec.rb
mercury-1.0.0 spec/lib/mercury/images_spec.rb
mercury-0.9.15 spec/lib/mercury/images_spec.rb
mercury-0.9.14 spec/lib/mercury/images_spec.rb
mercury-0.9.13 spec/lib/mercury/images_spec.rb
mercury-0.9.12 spec/lib/mercury/images_spec.rb
mercury-0.9.11 spec/lib/mercury/images_spec.rb
mercury-0.9.10 spec/lib/mercury/images_spec.rb