Skip to content

Commit

Permalink
Move the view-specific spec into a real view spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
eee-c committed Mar 28, 2009
1 parent 53e25c6 commit d14df07
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/views/recipe.haml_spec.rb
@@ -0,0 +1,17 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper' )
require 'haml'

describe "recipe.haml" do
before(:each) do
@title = "Recipe Title"
@recipe = { 'title' => @title }

template = File.read("./views/recipe.haml")
@engine = Haml::Engine.new(template)
end

it "should display the recipe's title" do
response = @engine.render(Object.new, :@recipe => @recipe)
response.should have_selector("h1", :content => @title)
end
end

0 comments on commit d14df07

Please sign in to comment.