Created
September 10, 2011 16:46
-
-
Save thillain/1208508 to your computer and use it in GitHub Desktop.
Show action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "posts/show.html.erb" do | |
before(:each) do | |
@post = assign(:post, stub_model(Post,:id=>1,:title => "Test",:description=>'Want to contribute Engines')) | |
end | |
it "displays the post title with description" do | |
render | |
rendered.should contain("Test") | |
rendered.should contain("Want to contribute Engines") | |
end | |
it "displays the edit link" do | |
render | |
rendered.should have_selector('a',:href=>edit_post_path(@post.id),:content => 'Edit') | |
end | |
it "displays the back link to list the post" do | |
render | |
rendered.should have_selector('a',:content=>'Back',:href=>posts_path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment