Sha256: c9c97cddf8cbb9fc35bc37fd5bc9443c31bf30fb08c9a4b9bf8a22cb1e7400e7

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

require 'action_tree'
require 'haml'

module Templated
  extend ActionTree::Basic
  class Node < ActionTree::Basic::Node; end
  class Query < ActionTree::Basic::Query; end
  #use ActionTree::Components::Templating
end


=begin
describe Templated::Node do

  pending 'still passes normal specs'

  it 'allows setting view path' do
    subject.view_path('Bahamas')
    subject.view_path.should == 'Bahamas'
  end

  it 'inherits view path' do
    subject.view_path('Brazil')
    subject.action('/mediocrity') { 'hmm..' }
    subject.match('/mediocrity').view_path.should == 'Brazil'
  end

  it 'inherits layout path' do
    subject.layout('Congo')
    subject.action('Uzbekistan') { }
    subject.match('Uzbekistan').layout.should == 'Congo'
  end

  # inherits layouts, independent by namespace

  describe 'renders' do

    it 'haml' do
      subject.view_path('.')
      subject.action { render 'spec/fixtures/test.haml' }
      subject.match.run.should == "<p>Yippee</p>\n"
    end

    it 'haml within a layout defined by an ancestor' do
      subject.layout('/spec/fixtures/test_layout.haml')
      subject.action('hi') { render 'spec/fixtures/test.haml' }
      subject.match('hi').run.should == "<body><p>Yippee</p></body>\n"
    end

  end

end

=end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
action_tree-0.2.0 spec/04_components/template_spec.rb