diff --git a/spec/controllers/sitemap_controller_spec.rb b/spec/controllers/sitemap_controller_spec.rb new file mode 100644 index 000000000..ac0aae359 --- /dev/null +++ b/spec/controllers/sitemap_controller_spec.rb @@ -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