#370: added specs for SitemapController
This commit is contained in:
parent
f495da7f74
commit
f0dc7b5151
|
@ -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
|
Loading…
Reference in New Issue