RSS feed tests

This commit is contained in:
Kevin Rio
2014-11-23 21:02:56 -05:00
parent eb4fae463f
commit 2111cddaef
6 changed files with 70 additions and 3 deletions

View File

@@ -1,13 +1,13 @@
require 'spec_helper'
feature 'Comments RSS feed' do
scenario 'This RSS feed exists' do
scenario 'The index feed exists' do
visit comments_path(:format => 'rss')
expect(page.status_code).to equal 200
end
scenario 'The feed title is what we expect' do
scenario 'The index title is what we expect' do
visit comments_path(:format => 'rss')
expect(page).to have_content "#{ENV['GROWSTUFF_SITE_NAME']} - Recent comments on all posts"
expect(page).to have_content "Recent comments on all posts (#{ENV['GROWSTUFF_SITE_NAME']})"
end
end

View File

@@ -0,0 +1,13 @@
require 'spec_helper'
feature 'Crops RSS feed' do
scenario 'The index feed exists' do
visit crops_path(:format => 'rss')
expect(page.status_code).to equal 200
end
scenario 'The index title is what we expect' do
visit crops_path(:format => 'rss')
expect(page).to have_content "Recently added crops (#{ENV['GROWSTUFF_SITE_NAME']})"
end
end

View File

@@ -0,0 +1,15 @@
require 'spec_helper'
feature 'Members RSS feed' do
let(:member) { FactoryGirl.create(:member) }
scenario 'The show action exists' do
visit member_path(member, :format => 'rss')
expect(page.status_code).to equal 200
end
scenario 'The show action title is what we expect' do
visit member_path(member, :format => 'rss')
expect(page).to have_content "#{member.login_name}'s recent posts (#{ENV['GROWSTUFF_SITE_NAME']})"
end
end

View File

@@ -0,0 +1,13 @@
require 'spec_helper'
feature 'Plantings RSS feed' do
scenario 'The index feed exists' do
visit plantings_path(:format => 'rss')
expect(page.status_code).to equal 200
end
scenario 'The index title is what we expect' do
visit plantings_path(:format => 'rss')
expect(page).to have_content "Recent plantings from #{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})"
end
end

View File

@@ -0,0 +1,13 @@
require 'spec_helper'
feature 'Posts RSS feed' do
scenario 'The index feed exists' do
visit posts_path(:format => 'rss')
expect(page.status_code).to equal 200
end
scenario 'The index title is what we expect' do
visit posts_path(:format => 'rss')
expect(page).to have_content "Recent posts from #{ @author ? @author : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})"
end
end

View File

@@ -0,0 +1,13 @@
require 'spec_helper'
feature 'Seeds RSS feed' do
scenario 'The index feed exists' do
visit seeds_path(:format => 'rss')
expect(page.status_code).to equal 200
end
scenario 'The index title is what we expect' do
visit seeds_path(:format => 'rss')
expect(page).to have_content "Recent seeds from #{ @owner ? @owner : 'all members' } (#{ENV['GROWSTUFF_SITE_NAME']})"
end
end