about summary refs log tree commit diff
path: root/spec/routing
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-31 15:36:24 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-31 21:36:24 +0200
commit5c6352397257d82e75b90cc5e7de1a3922bde7bd (patch)
tree38d617da023ed80e36d1255f8190b22b4a624c75 /spec/routing
parentde4681b2be0b0efa1dede092445a53d4a593c140 (diff)
Spec coverage and refactor for the api/v1/accounts controllers (#3451)
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/api_routing_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/routing/api_routing_spec.rb b/spec/routing/api_routing_spec.rb
index 973b4801d..6dfd074a0 100644
--- a/spec/routing/api_routing_spec.rb
+++ b/spec/routing/api_routing_spec.rb
@@ -1,6 +1,45 @@
 require 'rails_helper'
 
 describe 'API routes' do
+  describe 'Credentials routes' do
+    it 'routes to verify credentials' do
+      expect(get('/api/v1/accounts/verify_credentials')).
+        to route_to('api/v1/accounts/credentials#show')
+    end
+
+    it 'routes to update credentials' do
+      expect(patch('/api/v1/accounts/update_credentials')).
+        to route_to('api/v1/accounts/credentials#update')
+    end
+  end
+
+  describe 'Account routes' do
+    it 'routes to statuses' do
+      expect(get('/api/v1/accounts/user/statuses')).
+        to route_to('api/v1/accounts/statuses#index', account_id: 'user')
+    end
+
+    it 'routes to followers' do
+      expect(get('/api/v1/accounts/user/followers')).
+        to route_to('api/v1/accounts/follower_accounts#index', account_id: 'user')
+    end
+
+    it 'routes to following' do
+      expect(get('/api/v1/accounts/user/following')).
+        to route_to('api/v1/accounts/following_accounts#index', account_id: 'user')
+    end
+
+    it 'routes to search' do
+      expect(get('/api/v1/accounts/search')).
+        to route_to('api/v1/accounts/search#show')
+    end
+
+    it 'routes to relationships' do
+      expect(get('/api/v1/accounts/relationships')).
+        to route_to('api/v1/accounts/relationships#index')
+    end
+  end
+  
   describe 'Timeline routes' do
     it 'routes to home timeline' do
       expect(get('/api/v1/timelines/home')).