Sha256: 58dd2843b221483b14ceb772298b288021c8d926cd8a7815c9efb72fb5d69ac7

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'spec/helper'

spec_require 'sass/engine'

class TCTemplateSassController < Ramaze::Controller
  map '/'
  template_root __DIR__/:sass
  engine :Sass

  define_method('style.css') do
%{
body
  :margin 1em

  #content
    :text-align center
}
  end
end

class TCTemplateSassLocalsController < Ramaze::Controller
  map '/options'
  engine :Sass
  trait :sass_options => { :style => :compact }

  def test
%{
body
  margin: 1em

  #content
    font:
      family: monospace
      size: 10pt
}
  end
end

describe "Sass templates" do
  behaves_like 'http'
  ramaze(:compile => true)

  it "should render inline" do
    r = get('/style.css')
    r.headers['Content-Type'].should == "text/css"
    r.body.strip.should ==
"body {
  margin: 1em; }
  body #content {
    text-align: center; }"
  end

  it "should render from file" do
    r = get('/file.css')
    r.headers['Content-Type'].should == "text/css"
    r.body.strip.should ==
"body {
  margin: 1em; }
  body #content {
    text-align: center; }"
  end

  it "should use sass options" do
    get('/options/test').body.should.not =~ /^ +/
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ramaze-0.3.0 spec/ramaze/template/sass.rb
ramaze-0.3.5 spec/ramaze/template/sass.rb
ramaze-0.3.9 spec/ramaze/template/sass.rb
ramaze-0.3.9.1 spec/ramaze/template/sass.rb