From f0dc7b5151e05af91ec54ff93c3ae84c79136601 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 31 Mar 2014 22:49:54 +0400 Subject: [PATCH] #370: added specs for SitemapController --- spec/controllers/sitemap_controller_spec.rb | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 spec/controllers/sitemap_controller_spec.rb 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