闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

  1. require 'rails_helper'
  2. describe 'API routes' do
  3. describe 'Credentials routes' do
  4. it 'routes to verify credentials' do
  5. expect(get('/api/v1/accounts/verify_credentials')).
  6. to route_to('api/v1/accounts/credentials#show')
  7. end
  8. it 'routes to update credentials' do
  9. expect(patch('/api/v1/accounts/update_credentials')).
  10. to route_to('api/v1/accounts/credentials#update')
  11. end
  12. end
  13. describe 'Account routes' do
  14. it 'routes to statuses' do
  15. expect(get('/api/v1/accounts/user/statuses')).
  16. to route_to('api/v1/accounts/statuses#index', account_id: 'user')
  17. end
  18. it 'routes to followers' do
  19. expect(get('/api/v1/accounts/user/followers')).
  20. to route_to('api/v1/accounts/follower_accounts#index', account_id: 'user')
  21. end
  22. it 'routes to following' do
  23. expect(get('/api/v1/accounts/user/following')).
  24. to route_to('api/v1/accounts/following_accounts#index', account_id: 'user')
  25. end
  26. it 'routes to search' do
  27. expect(get('/api/v1/accounts/search')).
  28. to route_to('api/v1/accounts/search#show')
  29. end
  30. it 'routes to relationships' do
  31. expect(get('/api/v1/accounts/relationships')).
  32. to route_to('api/v1/accounts/relationships#index')
  33. end
  34. end
  35. describe 'Timeline routes' do
  36. it 'routes to home timeline' do
  37. expect(get('/api/v1/timelines/home')).
  38. to route_to('api/v1/timelines/home#show')
  39. end
  40. it 'routes to public timeline' do
  41. expect(get('/api/v1/timelines/public')).
  42. to route_to('api/v1/timelines/public#show')
  43. end
  44. it 'routes to tag timeline' do
  45. expect(get('/api/v1/timelines/tag/test')).
  46. to route_to('api/v1/timelines/tag#show', id: 'test')
  47. end
  48. end
  49. end