4 let
!(:feed_item1) { FactoryGirl
.create(:feed_item,
6 let
!(:feed_item2) { FactoryGirl
.create(:feed_item,
8 let
!(:other_feed_item) { FactoryGirl
.create(:feed_item,
9 feed_name
: "other_test_feed") }
11 it
"serves index as html by default" do
12 get_via_redirect
'/index'
13 expect(response
.header
['Content-Type']).to
include('text/html')
16 it
"serves index.html as html" do
17 get_via_redirect
'/index.html'
18 expect(response
.header
['Content-Type']).to
include('text/html')
21 it
"serves index.rss as rss" do
22 get_via_redirect
'/index.rss'
23 expect(response
.header
['Content-Type']).to
include('application/rss+xml')
26 it
"serves index as html with the accept header" do
27 get_via_redirect
'/index', {}, {'Accept' => 'text/html'}
28 expect(response
.header
['Content-Type']).to
include('text/html')
31 it
"serves index as rss with the accept header" do
32 get_via_redirect
'/index', {}, {'Accept' => 'application/rss+xml'}
33 expect(response
.header
['Content-Type']).to
include('application/rss+xml')
36 it
"serves feed as html by default" do
37 get_via_redirect
'/other_test_feed'
38 expect(response
.header
['Content-Type']).to
include('text/html')
41 it
"serves feed.html as html" do
42 get_via_redirect
'/other_test_feed.html'
43 expect(response
.header
['Content-Type']).to
include('text/html')
46 it
"serves feed.rss as rss" do
47 get_via_redirect
'/other_test_feed.rss'
48 expect(response
.header
['Content-Type']).to
include('application/rss+xml')
51 it
"serves feed as html with the accept header" do
52 get_via_redirect
'/other_test_feed', {}, {'Accept' => 'text/html'}
53 expect(response
.header
['Content-Type']).to
include('text/html')
56 it
"serves feed as rss with the accept header" do
57 get_via_redirect
'/other_test_feed', {}, {'Accept' => 'application/rss+xml'}
58 expect(response
.header
['Content-Type']).to
include('application/rss+xml')