Skip to content

Instantly share code, notes, and snippets.

@cmaujean
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmaujean/9668976 to your computer and use it in GitHub Desktop.
Save cmaujean/9668976 to your computer and use it in GitHub Desktop.
Example Route spec
# spec/routes/example_spec.rb
require 'spec_helper'
describe "routing for tab separation of example slug routed pages" do
it "routes to known tab names" do
expect( :get => "/example/far-out-man/reviews" ).to route_to(
:controller => "directory",
:action =>"show_tab",
:slug => "far-out-man",
:tab => "reviews"
)
end
end
# config/routes.rb
Example::Application.routes.draw do
match '/example/:slug/:tab' => 'directory#show_tab'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment