From 5282ba862a75cbbec81892a6a4cca7e798850178 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 9 Jun 2017 14:12:40 -0400 Subject: Move reblogged_by and favourited_by actions out of api/v1/statuses and into unique controllers (#3646) * Add specs for api statuses routes * Update favourited_by and reblogged_by api routes * Move methods into new controllers * Use load_accounts methods to simplify index actions * Clean up load_accounts methods * Clean up link header generation * Check for link headers in specs * Remove unused actions from api/v1/statuses controller * Remove specs for moved actions --- spec/routing/api_routing_spec.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'spec/routing') diff --git a/spec/routing/api_routing_spec.rb b/spec/routing/api_routing_spec.rb index 6dfd074a0..6c093f19d 100644 --- a/spec/routing/api_routing_spec.rb +++ b/spec/routing/api_routing_spec.rb @@ -39,7 +39,19 @@ describe 'API routes' do to route_to('api/v1/accounts/relationships#index') end end - + + describe 'Statuses routes' do + it 'routes reblogged_by' do + expect(get('/api/v1/statuses/123/reblogged_by')). + to route_to('api/v1/statuses/reblogged_by_accounts#index', status_id: '123') + end + + it 'routes favourited_by' do + expect(get('/api/v1/statuses/123/favourited_by')). + to route_to('api/v1/statuses/favourited_by_accounts#index', status_id: '123') + end + end + describe 'Timeline routes' do it 'routes to home timeline' do expect(get('/api/v1/timelines/home')). -- cgit