Merge branch 'master' into 236_paginate_has_many

This commit is contained in:
Mario Visic 2011-10-29 14:36:01 +08:00
commit 9f8906d840
2 changed files with 11 additions and 3 deletions

View File

@ -39,7 +39,7 @@ module Locomotive
end
def render_no_site_error
render :template => '/admin/errors/no_site', :layout => false
render :template => '/admin/errors/no_site', :layout => false, :status => :not_found
end
def validate_site_membership

View File

@ -147,11 +147,19 @@ describe Locomotive::Routing::SiteDispatcher do
describe '#render_no_site_error' do
it 'renders the no site template with no layout' do
@controller.expects(:render).with(:template => '/admin/errors/no_site', :layout => false)
before :each do
@controller.instance_variable_set('@_response', ActionDispatch::Response.new)
@controller.send(:render_no_site_error)
end
it 'should have a no site error message' do
@controller.response.body.should include 'No Site'
end
it 'should have a 404 not found status' do
@controller.response.should be_not_found
end
end
describe '#validate_site_membership' do