Sha256: 55227f314d5338163bed1f8c23ba6580808b190a17c6c00ca49bd39abc17211a

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

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'

class TCPartialHelperController < Ramaze::Controller
  map '/'
  helper :partial
  template_root(File.dirname(__FILE__)/:template)

  def index
    '<http><head><title>#{render_partial("/title")}</title></head></http>'
  end

  def title
    "Title"
  end

  def composed
    @here = 'there'
    'From Action | ' +
    render_template("partial.xhtml")
  end
end

describe "PartialHelper" do
  before :all do
    ramaze
  end

  it "should render partials" do
    get('/').body.should == '<http><head><title>Title</title></head></http>'
  end

  it 'should be able to render a template in the current scope' do
    get('/composed').body.should == 'From Action | From Partial there'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ramaze-0.1.2 spec/ramaze/helper/partial.rb