diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-06-10 03:39:26 -0400 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-10 09:39:26 +0200 |
commit | 2925372ff44347fa7066c380a5d51dd35f80682f (patch) | |
tree | 522c9bae03bbb1bbc7740a7edbddcce15195cd88 /spec/routing | |
parent | 778430b54a97b619189aaa4140f3e9fc16025323 (diff) |
Move create/destroy actions for api/v1/statuses to namespace (#3678)
Each of mute, favourite, reblog has been updated to: - Have a separate controller with just a create and destroy action - Preserve historical route names to not break the API - Mild refactoring to break up long methods
Diffstat (limited to 'spec/routing')
-rw-r--r-- | spec/routing/api_routing_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/routing/api_routing_spec.rb b/spec/routing/api_routing_spec.rb index 6c093f19d..2683ccb8d 100644 --- a/spec/routing/api_routing_spec.rb +++ b/spec/routing/api_routing_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' describe 'API routes' do @@ -50,6 +52,36 @@ describe 'API routes' do expect(get('/api/v1/statuses/123/favourited_by')). to route_to('api/v1/statuses/favourited_by_accounts#index', status_id: '123') end + + it 'routes reblog' do + expect(post('/api/v1/statuses/123/reblog')). + to route_to('api/v1/statuses/reblogs#create', status_id: '123') + end + + it 'routes unreblog' do + expect(post('/api/v1/statuses/123/unreblog')). + to route_to('api/v1/statuses/reblogs#destroy', status_id: '123') + end + + it 'routes favourite' do + expect(post('/api/v1/statuses/123/favourite')). + to route_to('api/v1/statuses/favourites#create', status_id: '123') + end + + it 'routes unfavourite' do + expect(post('/api/v1/statuses/123/unfavourite')). + to route_to('api/v1/statuses/favourites#destroy', status_id: '123') + end + + it 'routes mute' do + expect(post('/api/v1/statuses/123/mute')). + to route_to('api/v1/statuses/mutes#create', status_id: '123') + end + + it 'routes unmute' do + expect(post('/api/v1/statuses/123/unmute')). + to route_to('api/v1/statuses/mutes#destroy', status_id: '123') + end end describe 'Timeline routes' do |