Skip to content

Instantly share code, notes, and snippets.

@g-ilham
Last active August 29, 2015 14:09
Show Gist options
  • Save g-ilham/0b509aaaea9cf5cc78e2 to your computer and use it in GitHub Desktop.
Save g-ilham/0b509aaaea9cf5cc78e2 to your computer and use it in GitHub Desktop.
Rspec controllers with friendly_id
**Rspec controllers with friendly_id**
============================
it '/:account_id/:project_id/edit to Projects#edit' do
path = edit_account_project_path 'foocorp', 'widgets'
path.should == '/foocorp/widgets/edit'
{ :get => path }.should route_to(
:controller => 'projects',
:action => 'edit',
:account_id => 'foocorp',
:id => 'widgets'
)
end
===================
it '/ to Accounts#index' do
path = accounts_path
path.should == '/'
{ :get => path }.should route_to(
:controller => 'accounts',
:action => 'index'
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment