Restful refactor of accounts/ routes (#2133)
* Add routing specs for accounts followers and following actions * Use more restful route naming for public account follow pages Moves two actions: - accounts#followers to accounts/follower_accounts#index - accounts#following to accounts/following_accounts#index Adds routing spec to ensure prior URLs are preserved.
This commit is contained in:
parent
c0b30c56db
commit
8bac0350d1
18 changed files with 275 additions and 63 deletions
31
spec/routing/accounts_routing_spec.rb
Normal file
31
spec/routing/accounts_routing_spec.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe 'Routes under accounts/' do
|
||||
describe 'the route for accounts who are followers of an account' do
|
||||
it 'routes to the followers action with the right username' do
|
||||
expect(get('/users/name/followers')).
|
||||
to route_to('follower_accounts#index', account_username: 'name')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'the route for accounts who are followed by an account' do
|
||||
it 'routes to the following action with the right username' do
|
||||
expect(get('/users/name/following')).
|
||||
to route_to('following_accounts#index', account_username: 'name')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'the route for following an account' do
|
||||
it 'routes to the follow create action with the right username' do
|
||||
expect(post('/users/name/follow')).
|
||||
to route_to('account_follow#create', account_username: 'name')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'the route for unfollowing an account' do
|
||||
it 'routes to the unfollow create action with the right username' do
|
||||
expect(post('/users/name/unfollow')).
|
||||
to route_to('account_unfollow#create', account_username: 'name')
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue