Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Failures:
- 1) posts/index.html.haml renders a list of posts
- Failure/Error: render
- ActionView::Template::Error:
- undefined method `current_page' for #<Array:0x000001028ab4e0>
- # ./app/views/posts/index.html.haml:31:in `_app_views_posts_index_html_haml__291454070937541541_2193463480'
- # ./spec/views/posts/index.html.haml_spec.rb:39:in `block (2 levels) in <top (required)>'
- require 'spec_helper'
- describe "posts/index.html.haml" do
- before(:each) do
- ...
- assign(:posts, [
- Factory.stub(:post),
- Factory.stub(:post)
- ])
- view.should_receive(:date_as_string).twice.and_return("June 17, 2011")
- ...
- end
- it "renders a list of posts" do
- render
- rendered.should have_content("June 17, 2011")
- ...
- end
- end
- before(:each) do
- ...
- posts = [Factory.stub(:post), Factory.stub(:post)]
- posts.stub!(:current_page).and_return("foo")
- assign(:posts, posts)
- view.should_receive(:date_as_string).twice.and_return("June 17, 2011")
- ...
- end
- assign(:posts, Kaminari.paginate_array([
- Factory.stub(:post),
- Factory.stub(:post)
- ]).page(1))
Add Comment
Please, Sign In to add comment