about summary refs log tree commit diff
path: root/spec/routing/api_routing_spec.rb
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-06-09 14:12:40 -0400
committerGitHub <noreply@github.com>2017-06-09 14:12:40 -0400
commit5282ba862a75cbbec81892a6a4cca7e798850178 (patch)
tree39f394e4eaedbf882095824a7d21d69749b7b9ea /spec/routing/api_routing_spec.rb
parent04646029785f25202cfdcb8d5a1d31948244ac7a (diff)
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
Diffstat (limited to 'spec/routing/api_routing_spec.rb')
-rw-r--r--spec/routing/api_routing_spec.rb14
1 files changed, 13 insertions, 1 deletions
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')).