From 75a607a00d0fa089b0b45058d654dbad71e05eeb Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 6 Jan 2014 17:58:39 +0000 Subject: [PATCH] Added routing spec --- spec/routing/feedcatcher_routing_spec.rb | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 spec/routing/feedcatcher_routing_spec.rb diff --git a/spec/routing/feedcatcher_routing_spec.rb b/spec/routing/feedcatcher_routing_spec.rb new file mode 100644 index 0000000..6121c6b --- /dev/null +++ b/spec/routing/feedcatcher_routing_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe "routes for feedcatcher" do + it "routes / to index" do + expect(get('/')).to route_to('feed#index') + end + + it "routes /index(.:format) to feed#index" do + expect(get('/index')).to route_to('feed#index') + expect(get('/index.html')).to route_to(controller: 'feed', + action: 'index', format: 'html') + expect(get('/index.rss')).to route_to(controller: 'feed', + action: 'index', format: 'rss') + end + + it "routes /:feed_name.:format) to feed" do + expect(get('/myfeed')).to route_to(controller: 'feed', + action: 'show', feed_name: 'myfeed') + expect(get('/myfeed.html')).to route_to(controller: 'feed', + action: 'show', + feed_name: 'myfeed', + format: 'html') + expect(get('/myfeed.rss')).to route_to(controller: 'feed', + action: 'show', + feed_name: 'myfeed', + format: 'rss') + end +end -- 2.34.1