spec/requests/error_page_spec.rb in rambulance-0.1.1 vs spec/requests/error_page_spec.rb in rambulance-0.1.2
- old
+ new
@@ -36,13 +36,33 @@
page.status_code.should == 404
page.body.should have_content "Error page"
page.body.should have_content "Page not found."
end
+
+ context "with a custom layout name" do
+ before do
+ @org, Rambulance.layout_name = Rambulance.layout_name, "application"
+ end
+ after { Rambulance.layout_name = @org }
+
+ scenario 'uses the custom layout' do
+ visit '/doesnt_exist'
+ page.body.should have_content "Application page"
+ end
+ end
end
context "With a custom exception app", if: ENV["CUSTOM_EXCEPTIONS_APP"] do
it_behaves_like "an action that renders 500 page if the template is missing"
+
+ scenario 'Not found due to ActinoController::RoutingError' do
+ visit '/doesnt_exist'
+
+ page.status_code.should == 404
+ page.body.should have_content "Error page"
+ page.body.should have_content "Page not found."
+ end
scenario 'Internal server error due to RuntimeError' do
visit '/users/1'
page.status_code.should == 500