about summary refs log tree commit diff
path: root/spec/routing
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-23 12:11:39 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-23 18:11:39 +0200
commit4289ed1d13b9c3b91663581c44635105c4bc0412 (patch)
tree5f8f006a47676ac15bb0374c21a2dea4a6a40910 /spec/routing
parent256e3adc1d9508423aab8fcfb13745c9f85ff948 (diff)
Refactor of API timeline actions (#3263)
- Increase coverage to exercise all parts of each action
- Move into namespace to share common code
- Misc refactor of each action for smaller methods, simpler code
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/api_timelines_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/routing/api_timelines_spec.rb b/spec/routing/api_timelines_spec.rb
new file mode 100644
index 000000000..31717209f
--- /dev/null
+++ b/spec/routing/api_timelines_spec.rb
@@ -0,0 +1,18 @@
+require 'rails_helper'
+
+describe 'API timeline routes' do
+  it 'routes to home timeline' do
+    expect(get('/api/v1/timelines/home')).
+      to route_to('api/v1/timelines/home#show')
+  end
+
+  it 'routes to public timeline' do
+    expect(get('/api/v1/timelines/public')).
+      to route_to('api/v1/timelines/public#show')
+  end
+
+  it 'routes to tag timeline' do
+    expect(get('/api/v1/timelines/tag/test')).
+      to route_to('api/v1/timelines/tag#show', id: 'test')
+  end
+end