#370: added specs for SitemapController

This commit is contained in:
Vokhmin Alexey V 2014-03-31 22:49:54 +04:00
parent f495da7f74
commit f0dc7b5151
1 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
require 'spec_helper'
describe SitemapController do
describe 'robots' do
it 'is successful' do
get :robots
response.should be_success
response.should render_template('sitemap/robots')
end
context 'validate robots.txt' do
render_views
it 'ensures that Host is correct' do
get :robots
response.body.should match(/^Host: http:\/\/test.host$/)
end
it 'ensures that Sitemap is correct' do
get :robots
response.body.should match(/^Sitemap: http:\/\/test.host\/sitemap.xml.gz$/)
end
end
end
describe 'show' do
it 'is successful' do
get :show
response.should redirect_to("/sitemaps/test.host/sitemap.xml.gz")
end
end
end