Sha256: 13988b2619abd9e8e3cdac5f994d85ef08ebcb6f17233a5a1b881238280ba364

Contents?: true

Size: 1.32 KB

Versions: 20

Compression:

Stored size: 1.32 KB

Contents

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

describe SC::Target, 'manifest_for' do

  include SC::SpecHelpers

  before do
    @project = fixture_project(:real_world)
    @target = @project.target_for :sproutcore
  end
  
  it "should return a new manifest instance for a new variation with variation properties set" do
    manifest = @target.manifest_for :language => :en
    manifest.should_not be_nil
    manifest.language.should eql(:en)
  end
  
  it "should return the same manifest instance for the same variation" do
    manifest_en = @target.manifest_for :language => :en
    manifest_fr = @target.manifest_for :language => :fr
    
    @target.manifest_for(:language => :en).should eql(manifest_en)
    @target.manifest_for(:language => :fr).should eql(manifest_fr)
  end
  
  it "should return first manifest matching variation if multiples match" do
    manifest1 = @target.manifest_for :language => :en, :vers => 1
    manifest2 = @target.manifest_for :language => :en, :vers => 2

    found = @target.manifest_for(:language => :en)
    found.vers.should eql(1)
  end
  
  # IMPORTANT:  This condition is assumed by the manifest/prepare_spec.
  it "should NOT call prepare! when creating a new manifest" do
    manifest = @target.manifest_for :language => :en
    manifest.prepared?.should be_false
  end
  
end

    

Version data entries

20 entries across 20 versions & 2 rubygems

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