Guest User

Untitled

a guest
Jul 21st, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Failures:
  2.  
  3. 1) posts/index.html.haml renders a list of posts
  4. Failure/Error: render
  5. ActionView::Template::Error:
  6. undefined method `current_page' for #<Array:0x000001028ab4e0>
  7. # ./app/views/posts/index.html.haml:31:in `_app_views_posts_index_html_haml__291454070937541541_2193463480'
  8. # ./spec/views/posts/index.html.haml_spec.rb:39:in `block (2 levels) in <top (required)>'
  9.  
  10. require 'spec_helper'
  11.  
  12. describe "posts/index.html.haml" do
  13. before(:each) do
  14. ...
  15. assign(:posts, [
  16. Factory.stub(:post),
  17. Factory.stub(:post)
  18. ])
  19. view.should_receive(:date_as_string).twice.and_return("June 17, 2011")
  20. ...
  21. end
  22.  
  23. it "renders a list of posts" do
  24. render
  25. rendered.should have_content("June 17, 2011")
  26. ...
  27. end
  28. end
  29.  
  30. before(:each) do
  31. ...
  32. posts = [Factory.stub(:post), Factory.stub(:post)]
  33. posts.stub!(:current_page).and_return("foo")
  34. assign(:posts, posts)
  35. view.should_receive(:date_as_string).twice.and_return("June 17, 2011")
  36. ...
  37. end
  38.  
  39. assign(:posts, Kaminari.paginate_array([
  40. Factory.stub(:post),
  41. Factory.stub(:post)
  42. ]).page(1))
Add Comment
Please, Sign In to add comment