Sha256: c3a30b26ca716f1969732d61fe474bdb5ce03ac9b3d51ecdc1bfc8e38b798807

Contents?: true

Size: 993 Bytes

Versions: 2

Compression:

Stored size: 993 Bytes

Contents

describe RetinaRails::Extensions do

  describe :optimze_path do

    subject { RetinaRails::Extensions }

    it { subject.optimize_path('/:filename').should == '/:basename:retina.:extension' }

    it { subject.optimize_path('/:basename.:extension').should == '/:basename:retina.:extension' }

  end

  describe :override_default_options do

    context 'Paperclip default' do

      before { RetinaRails::Extensions.override_default_options }

      it { Paperclip::Attachment.default_options[:url].should == '/system/:class/:attachment/:id_partition/:style/:basename:retina.:extension' }

    end

    context 'User defined paperclip default' do

      before do

        Paperclip::Attachment.default_options[:url] = '/:class/:attachment/:id/:style/:basename.:extension'
        RetinaRails::Extensions.override_default_options

      end

      it { Paperclip::Attachment.default_options[:url].should == '/:class/:attachment/:id/:style/:basename:retina.:extension' }

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
retina_rails-0.1.3 spec/extensions_spec.rb
retina_rails-0.1.2 spec/extensions_spec.rb