Skip to content

Instantly share code, notes, and snippets.

@ohammersmith
Created April 23, 2009 00:17
Show Gist options
  • Select an option

  • Save ohammersmith/100184 to your computer and use it in GitHub Desktop.

Select an option

Save ohammersmith/100184 to your computer and use it in GitHub Desktop.
describe "#route_for" do
it "should be nested shallowly under forums as topics" do
params_from(:get, '/forums/123/topics').should == {:controller => "forum_posts", :action => "index", :forum_id => "123" }
end
it "should be nested shallowly under topics as posts" do
params_from(:get, '/topics/123/posts').should == {:controller => "forum_posts", :action => "index", :topic_id => "123" }
params_from(:get, '/posts/321').should == {:controller => "forum_posts", :action => "show", :id => "321" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment