Skip to content

Instantly share code, notes, and snippets.

@DAddYE
Created February 19, 2010 23:54
Show Gist options
  • Save DAddYE/309374 to your computer and use it in GitHub Desktop.
Save DAddYE/309374 to your computer and use it in GitHub Desktop.
##
# Rspec way routes and context filters
#
MyApp.context :frontend do
context :posts do
get :index do; ... end
get :show, :with => :id do; ... end
end
context :pages do
before do; do_some_before_only_for_pages_context; end
get :index do; ... end
get :show, :with => :id do; ... end
after do; do_some_after_only_for_pages_context; end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment