Sha256: 1674ee6f65d1dc86713c6af5f9ba7a48ffb2a46e556c347565c322f12a463bc7

Contents?: true

Size: 642 Bytes

Versions: 7

Compression:

Stored size: 642 Bytes

Contents

require 'spec_helper'

module Alchemy
  describe Attachment do

    describe '#urlname' do

      context "with url characters in the filename" do
        subject { Attachment.new(:filename => 'f#%&cking cute kitten pic.png') }

        it "should escape as uri" do
          subject.urlname.should == 'f___cking_cute_kitten_pic.png'
        end
      end

      context "with lot of dots in the name" do
        subject { Attachment.new(:filename => 'cute.kitten.pic.png') }

        it "should convert dots in the name part into dashes" do
          subject.urlname.should == 'cute-kitten-pic.png'
        end
      end

    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
alchemy_cms-2.5.3.1 spec/models/attachment_spec.rb
alchemy_cms-2.5.3 spec/models/attachment_spec.rb
alchemy_cms-2.5.2.2 spec/models/attachment_spec.rb
alchemy_cms-2.5.2.1 spec/models/attachment_spec.rb
alchemy_cms-2.5.2 spec/models/attachment_spec.rb
alchemy_cms-2.5.1 spec/models/attachment_spec.rb
alchemy_cms-2.5.0 spec/models/attachment_spec.rb