Skip to content

Instantly share code, notes, and snippets.

@jerry
Created January 20, 2010 20:16
Show Gist options
  • Save jerry/282202 to your computer and use it in GitHub Desktop.
Save jerry/282202 to your computer and use it in GitHub Desktop.
Loaded suite /Users/jerry/sites/rhv/test/functional/posts_controller_test
Started
..E.
Finished in 1.226551 seconds.
1) Error:
test: A signed in admin on POST to :create should redirect to the post page. (PostsControllerTest):
ActionController::RoutingError: post_url failed to generate from {:controller=>"posts", :action=>"show", :id=>nil}, expected: {:controller=>"posts", :action=>"show"}, diff: {:id=>nil}
method post_url in (eval) at line 16
method __bind_1264018691_837170 in posts_controller_test.rb at line 40
method instance_eval in macros.rb at line 233
method __bind_1264018693_152665 in macros.rb at line 233
method call in context.rb at line 253
method test: A signed in admin on POST to :create should redirect to the post page. in context.rb at line 253
4 tests, 4 assertions, 0 failures, 1 errors
context "on POST to :create" do
setup do
post :create, :post => Factory.attributes_for(:post)
end
should_assign_to(:post) { @post }
should_redirect_to("the post page") { post_url(@post) }
should_set_the_flash_to(/created/i)
should_change "Post.count", :by => 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment