Skip to content

Instantly share code, notes, and snippets.

@xirukitepe
Created November 7, 2012 08:09
Show Gist options
  • Save xirukitepe/4030132 to your computer and use it in GitHub Desktop.
Save xirukitepe/4030132 to your computer and use it in GitHub Desktop.
Sample rspec test for routes
describe "routing to profiles" do
it "routes /profile/:username to profile#show for username" do
{ :get => "/profiles/jsmith" }.should route_to(
:controller => "profiles",
:action => "show",
:username => "jsmith"
)
end
it "does not expose a list of profiles" do
{ :get => "/profiles" }.should_not be_routable
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment