Sha256: c83e600cef7be1443be5ada46930ea6b9c03905e9079bf0aa874b56241d64ae7

Contents?: true

Size: 969 Bytes

Versions: 20

Compression:

Stored size: 969 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])

describe SC::ManifestEntry, 'timestamp_url' do
  
  include SC::SpecHelpers
  
  before do
    @project = fixture_project(:real_world)
    @target = @project.target_for :contacts
    @manifest = @target.manifest_for(:language => :en)
    
    # create entry manually to avoid calling prepare
    @entry = SC::ManifestEntry.new @manifest, 
      :filename => "filename", 
      :url => "foo",
      :source_path => "imaginary" / "path"
  end

  it "should return url itself if timestamp_url config is false" do
    @target.config.timestamp_urls = false # preconditon
    @entry.cacheable_url.should == 'foo'
  end
  
  it "should return url with timestamp token appended as query string if timestamp_url is true" do
    @target.config.timestamp_urls = true # preconditon
    @entry.timestamp.should_not be_blank # preconditon
    @entry.cacheable_url.should == "foo?#{@entry.timestamp}"
  end

  
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutit-sproutcore-1.0.0.20090408130025 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutit-sproutcore-1.0.20090721145236 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1046 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1043 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1042 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1037 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1035 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1031 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1030 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1029 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1027 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1028 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1026 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1025 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1024 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1009 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1008 spec/lib/models/manifest_entry/cacheable_url_spec.rb
sproutcore-1.0.1003 spec/lib/models/manifest_entry/cacheable_url_spec.rb