Skip to content

Instantly share code, notes, and snippets.

@tomtt
Created May 3, 2009 03:03
Show Gist options
  • Select an option

  • Save tomtt/105805 to your computer and use it in GitHub Desktop.

Select an option

Save tomtt/105805 to your computer and use it in GitHub Desktop.
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe CommentsController do
describe "create" do
describe "with valid parameters" do
it "should redirect to the enclosing resource page after successful submit when nested in aliased url" do
news_article = Factory.create(:news_article)
post(:create,
:comment => {},
:news_article_id => news_article.to_param)
response.should redirect_to(news_article_path(news_article, { 'comment[body]' => '' }))
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment