Sha256: 9b34aeaaa80610889ffbddcd82193dcaae8ccabaed90fd9435e38f79b9edb616

Contents?: true

Size: 966 Bytes

Versions: 2

Compression:

Stored size: 966 Bytes

Contents

require 'spec_helper'

describe ApplicationHelper, :type => :helper do
  it 'adds size to images' do
    tag = helper.image_tag('rails.png')
    tag.should match('height="64"')
    tag.should match('width="50"')
  end

  it "works with a missing image" do
    tag = helper.image_tag('missing.png')
    tag.should_not match('height=')
    tag.should_not match('width=')
  end

  it 'works even if the image is not in the asset pipeline' do
    tag = helper.image_tag('/outsiders/rails.png')
    tag.should match('height="64"')
    tag.should match('width="50"')
  end

  it 'is disabled passing false to the :dimensions option' do
    tag = helper.image_tag('/outsiders/rails.png', :dimensions => false)
    tag.should_not match('height=')
    tag.should_not match('width=')
  end

  it 'should not add dimensions attribute to image' do
    tag = helper.image_tag('/outsiders/rails.png', :dimensions => false)
    tag.should_not match('dimensions="false"')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dimensions-rails-1.1.2 spec/helper/dimensions-rails_spec.rb
dimensions-rails-1.1.1 spec/helper/dimensions-rails_spec.rb