Sha256: fa41b05ff3f70aa27fac5f54a683e6b023f933b75fc18cfe7f82539b6aa4169c

Contents?: true

Size: 1.22 KB

Versions: 71

Compression:

Stored size: 1.22 KB

Contents

require File.dirname(__FILE__) + '/helper'

context "Sass" do

  setup do
    Sinatra.application = nil
  end

  context "Templates (in general)" do

    setup do
      Sinatra.application = nil
    end

    specify "are read from files if Symbols" do

      get '/from_file' do
        sass :foo, :views_directory => File.dirname(__FILE__) + "/views"
      end

      get_it '/from_file'
      should.be.ok
      body.should.equal "#sass {\n  background_color: #FFF; }\n"

    end

    specify "raise an error if template not found" do
      get '/' do
        sass :not_found
      end

      lambda { get_it '/' }.should.raise(Errno::ENOENT)
    end

    specify "ignore default layout file with .sass extension" do
      get '/' do
        sass :foo, :views_directory => File.dirname(__FILE__) + "/views/layout_test"
      end

      get_it '/'
      should.be.ok
      body.should.equal "#sass {\n  background_color: #FFF; }\n"
    end

    specify "ignore explicitly specified layout file" do
      get '/' do
        sass :foo, :layout => :layout, :views_directory => File.dirname(__FILE__) + "/views/layout_test"
      end

      get_it '/'
      should.be.ok
      body.should.equal "#sass {\n  background_color: #FFF; }\n"
    end

  end

end

Version data entries

71 entries across 71 versions & 12 rubygems

Version Path
3mix-castronaut-0.5.0.2 vendor/sinatra/test/sass_test.rb
Syd-sinatra-0.3.2 test/sass_test.rb
Syd-sinatra-0.9.0.2 compat/sass_test.rb
Syd-sinatra-0.9.0.4 compat/sass_test.rb
adamwiggins-sinatra-0.8.9 compat/sass_test.rb
bmizerany-sinatra-0.3.2 test/sass_test.rb
bmizerany-sinatra-0.8.10 compat/sass_test.rb
bmizerany-sinatra-0.8.9 compat/sass_test.rb
bmizerany-sinatra-0.9.0.2 compat/sass_test.rb
bmizerany-sinatra-0.9.0.4 compat/sass_test.rb
bmizerany-sinatra-0.9.0.5 compat/sass_test.rb
bmizerany-sinatra-0.9.0 compat/sass_test.rb
bmizerany-sinatra-0.9.1 compat/sass_test.rb
darkhelmet-sinatra-0.9.0.5 compat/sass_test.rb
darkhelmet-sinatra-0.9.1.1 compat/sass_test.rb
darkhelmet-sinatra-0.9.1 compat/sass_test.rb
masover-castronaut-0.4.4.4 vendor/sinatra/test/sass_test.rb
masover-castronaut-0.4.4.5 vendor/sinatra/test/sass_test.rb
masover-castronaut-0.5.0.1 vendor/sinatra/test/sass_test.rb
p8-castronaut-0.6.1.1 vendor/sinatra/compat/sass_test.rb