Sha256: 7450e98ba39508645ff24194edea8d9bbd693f5f1257f6fa23a07c701d058132

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

require 'spec_helper'

describe HandlebarsController do
  render_views

  before do
    Stache.template_base_path = ::Rails.root.join('app', 'views')
  end

  it "can get to index and render a Handlebars" do
    get :index
    assert_response 200

    response.should render_template 'index'
    response.body.should =~ /Hello, Matt!/
  end

  it "correctly renders partials" do
    get :with_partials
    assert_response 200

    response.body.should =~ /Grue/
    # puts response.body
  end

  it "correctly uses helpers" do
    get :with_helpers
    assert_response 200

    response.body.should =~ /Here's an image_path=\/assets\/image\.png/
    response.body.should =~ /Here's a capitalized string: Lowercase/
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stache-0.9.0 spec/controllers/handlebars_controller_spec.rb