Added routing spec
[feedcatcher.git] / spec / routing / feedcatcher_routing_spec.rb
1 require 'spec_helper'
2
3 describe "routes for feedcatcher" do
4 it "routes / to index" do
5 expect(get('/')).to route_to('feed#index')
6 end
7
8 it "routes /index(.:format) to feed#index" do
9 expect(get('/index')).to route_to('feed#index')
10 expect(get('/index.html')).to route_to(controller: 'feed',
11 action: 'index', format: 'html')
12 expect(get('/index.rss')).to route_to(controller: 'feed',
13 action: 'index', format: 'rss')
14 end
15
16 it "routes /:feed_name.:format) to feed" do
17 expect(get('/myfeed')).to route_to(controller: 'feed',
18 action: 'show', feed_name: 'myfeed')
19 expect(get('/myfeed.html')).to route_to(controller: 'feed',
20 action: 'show',
21 feed_name: 'myfeed',
22 format: 'html')
23 expect(get('/myfeed.rss')).to route_to(controller: 'feed',
24 action: 'show',
25 feed_name: 'myfeed',
26 format: 'rss')
27 end
28 end