rosa-build/spec/controllers/sitemap_controller_spec.rb

37 lines
785 B
Ruby
Raw Normal View History

require 'spec_helper'
2015-02-19 01:12:08 +00:00
describe SitemapController, type: :controller do
describe 'robots' do
it 'is successful' do
get :robots
2015-04-07 20:43:40 +01:00
expect(response).to be_success
expect(response).to render_template('sitemap/robots')
end
context 'validate robots.txt' do
render_views
it 'ensures that Host is correct' do
get :robots
2015-04-07 20:43:40 +01:00
expect(response.body).to match(/^Host: http:\/\/test.host$/)
end
it 'ensures that Sitemap is correct' do
get :robots
2015-04-07 20:43:40 +01:00
expect(response.body).to match(/^Sitemap: http:\/\/test.host\/sitemap.xml.gz$/)
end
end
end
describe 'show' do
it 'is successful' do
get :show
2015-04-07 20:43:40 +01:00
expect(response).to redirect_to("/sitemaps/test.host/sitemap.xml.gz")
end
end
end