Sha256: 29412832224db9d8cf303048c4266dbf91f9cc30e350140fec4dae24af919782

Contents?: true

Size: 855 Bytes

Versions: 17

Compression:

Stored size: 855 Bytes

Contents

require 'spec/spec_helper'

describe HamlLayouts::Models::Layout do
  
  dataset :layouts_layouts, :layouts_pages
  
  describe 'content' do
    context 'a haml layout' do
      it 'should return html rendered' do
        expected = <<-CONTENT
<r:inside_layout name='parent'>
  <h1 data-layout="<r:find url='find'><r:layout/></r:find>" id='<r:layout/>'>
    <r:layout></r:layout>
  </h1>
</r:inside_layout>
CONTENT
        layouts(:haml).rendered_content.should === expected
      end
    end
  end
  
  describe 'is_haml?' do
    context 'layout has a content type of haml' do
      it 'should return true' do
        layouts(:haml).is_haml?.should be_true
      end
    end
    
    context 'layout does not have a content type of haml' do
      it 'should return false' do
        layouts(:child).is_haml?.should be_false
      end
    end
  end
  
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
trusty-layouts-extension-3.1.1 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-3.1.0 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-3.0.0 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-2.0.4 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-2.0.3 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-2.0.2 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-2.0.1 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-2.0.0.pre.beta spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-1.1.0 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-1.0.4 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-1.0.3 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-1.0.2 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-1.0.1 spec/lib/haml_layouts/models/layout_spec.rb
trusty-layouts-extension-1.0.0 spec/lib/haml_layouts/models/layout_spec.rb
radiant-layouts-extension-1.1.3 spec/lib/haml_layouts/models/layout_spec.rb
radiant-layouts-extension-1.1.2 spec/lib/haml_layouts/models/layout_spec.rb
radiant-layouts-extension-1.1.1 spec/lib/haml_layouts/models/layout_spec.rb