Guest User

Untitled

a guest
Jan 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. describe "posts/show.html.erb" do
  4. before(:each) do
  5. @post = assign(:post, stub_model(Post,:id=>1,:title => "Test",:description=>'Want to contribute Engines'))
  6. end
  7. it "displays the post title with description" do
  8. render
  9. rendered.should contain("Test")
  10. rendered.should contain("Want to contribute Engines")
  11. end
  12.  
  13. it "displays the edit link" do
  14. render
  15. rendered.should have_selector('a',:href=>edit_post_path(@post.id),:content => 'Edit')
  16. end
  17.  
  18. it "displays the back link to list the post" do
  19. render
  20. rendered.should have_selector('a',:content=>'Back',:href=>posts_path)
  21. end
  22.  
  23. end
Add Comment
Please, Sign In to add comment