Sha256: ba543edb0a1c704acf427e0f8e097aa3323bb48a49f063b44448853fee29837b

Contents?: true

Size: 999 Bytes

Versions: 8

Compression:

Stored size: 999 Bytes

Contents

describe RetinaRails::Extensions do

  describe :optimze_path do

    subject { RetinaRails::Extensions }

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

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

  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.:extensions' }

    end

    context 'User defined paperclip default' do

      before do

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

      end

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

    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
retina_rails-0.1.1 spec/extensions_spec.rb
retina_rails-0.1.0 spec/extensions_spec.rb
retina_rails-0.0.6 spec/extensions_spec.rb
retina_rails-0.0.5 spec/extensions_spec.rb
retina_rails-0.0.4 spec/extensions_spec.rb
retina_rails-0.0.3 spec/extensions_spec.rb
retina_rails-0.0.2 spec/extensions_spec.rb
retina_rails-0.0.1 spec/extensions_spec.rb