Sha256: 0956bb26cf6c4bbfe47cde0e2a158c747752321144f1dc7a66be9eb56bafa134

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require 'minitest/spec'
require 'minitest/autorun'

require_relative 'project/controller'

describe Rail::Application do
  it 'handles uncompressed Haml assets' do
    controller = Controller.new do
      config.compress = false
    end
    body = controller.process('/')
    assert_equal body.strip, <<-BODY.strip
<!DOCTYPE html>
<html>
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>Hello</h1>
  </body>
</html>
    BODY
  end

  it 'handles compressed Haml assets' do
    controller = Controller.new do
      config.compress = true
    end
    body = controller.process('/')
    assert_equal body.strip, <<-BODY.strip
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
</head>
<body>
<h1>Hello</h1>
</body>
</html>
    BODY
  end

  it 'handles layouts' do
    controller = Controller.new do
      config.compress = false
    end
    body = controller.process('/articles/about')
    assert_equal body.strip, <<-BODY.strip
<!DOCTYPE html>
<html>
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>About</h1>
  </body>
</html>
    BODY
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rail-0.0.7 spec/haml_spec.rb
rail-0.0.6 spec/haml_spec.rb