Sha256: b36332f07eb2c91978a27d9787533c416faa983dae0efa74bf7c374f0250072b

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

require 'spec/spec_helper'

describe "esi include" do
  
  it "should include a src" do
    build_app('spec/tags/fixtures/include/src.html', {'/great' => "<p>This is great</p>"}).last.should == ["<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body><p>This is great</p></body></html>\n"]
  end
  
  it "should include an alt if src is unavilable" do
    build_app('spec/tags/fixtures/include/alt.html', {'/alternate' => "<p>This is great</p>"}).last.should == ["<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body><p>This is great</p></body></html>\n"]
  end
  
  it "should raise an error if src is unavilable" do
    proc { build_app('spec/tags/fixtures/include/src.html', {}) }.should raise_error
  end
  
  it "should raise an error if src and alt is unavilable" do
    proc { build_app('spec/tags/fixtures/include/alt.html', {}) }.should raise_error
  end
  
  it "should continue though, if onerror=continue" do
    build_app('spec/tags/fixtures/include/src_continue.html', {}).last.should == ["<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body></body></html>\n"]
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joshbuddy-esi-for-rack-0.0.1 spec/tags/include_spec.rb
joshbuddy-esi-for-rack-0.0.2 spec/tags/include_spec.rb