Last active
August 29, 2015 14:09
-
-
Save g-ilham/0b509aaaea9cf5cc78e2 to your computer and use it in GitHub Desktop.
Rspec controllers with friendly_id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**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