Sha256: eafdce74f882669af2d34a233ed0a6353a5cb960f350a6a4aab7b759526046b7

Contents?: true

Size: 1.19 KB

Versions: 65

Compression:

Stored size: 1.19 KB

Contents

require "spec_helper"

describe SC::ManifestEntry, 'hyperdomain_prefix' 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.jpg",
      :source_path => "imaginary" / "path"
  end

  it "should not alter url by calling hyperdomain_prefix if hyper_domaining array is empty in config" do
    @target.config.timestamp_urls = false # preconditon for the simplicity of this test

    @entry.cacheable_url.should == '/foo.jpg'
  end

  it "should prepend a fully qualified hyper domain to the url by calling hyperdomain_prefix if hyper_domaining array is NOT empty in config" do
    @target.config.timestamp_urls = false  # preconditon for the simplicity of this test

    @target.config.hyper_domaining = ["http://hyper1.sproutcore.com", "http://hyper2.sproutcore.com"]
    # hashing algorithm should pick 'http://hyper2.sproutcore.com' as the hyper domain
    @entry.cacheable_url.should == 'http://hyper2.sproutcore.com/foo.jpg'
  end


end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
sproutcore-1.11.0 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.11.0.rc3 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.11.0.rc2 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.11.0.rc1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.3.1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.2 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.0 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.0.rc.3 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.0.rc.2 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.10.0.rc.1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.9.2 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.9.1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.9.0 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.8.2.1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.8.1 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.8.0 spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.7.1.beta-java spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.7.1.beta spec/lib/models/manifest_entry/hyperdomain_prefix.rb
sproutcore-1.6.0.1-java spec/lib/models/manifest_entry/hyperdomain_prefix.rb