Sha256: 283cc4f2c01e730d65380b242f7117a09f350fba9c1f4e61c3eafacce1a38ff8

Contents?: true

Size: 982 Bytes

Versions: 7

Compression:

Stored size: 982 Bytes

Contents

require 'spec_helper'

describe Evergreen::Template do
  let(:suite) { Evergreen::Suite.new }
  subject { Evergreen::Template.new(suite, 'one_template.html') }

  its(:name) { should == 'one_template.html' }
  its(:root) { should == File.expand_path('suite1', File.dirname(__FILE__)) }
  its(:full_path) { should == File.expand_path("spec/javascripts/templates/one_template.html", Evergreen.root) }
  its(:contents) { should =~ %r(<h1 id="from\-template">This is from the template</h1>) }

  context "with existing spec file" do
    it { should exist }
  end

  context "with missing spec file" do
    subject { Evergreen::Template.new(suite, 'does_not_exist.html') }
    it { should_not exist }
  end

end

describe Evergreen::Template, "escaping" do
  let(:suite) { Evergreen::Suite.new }
  subject { Evergreen::Template.new(suite, 'escape.html') }

  it "escapes contents" do
    subject.escaped_contents.strip.should == %{"<scr" + "ipt>var foo = 0;</scr" + "ipt>\\n"}
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
evergreen-1.2.0 spec/template_spec.rb
evergreen-1.1.3 spec/template_spec.rb
evergreen-1.1.2 spec/template_spec.rb
evergreen-1.1.0 spec/template_spec.rb
evergreen-1.0.1 spec/template_spec.rb
evergreen-1.0.0 spec/template_spec.rb
evergreen-1.0.0.rc spec/template_spec.rb