It looks like you can use ActiveRecord::Base.remove_connection to simulate a database failure. Using RSpec, it would look like this:
describe "GET running" do it "renders a 500 if crashed" do ActiveRecord::Base.remove_connection get :running response.response_code.should == 500 ActiveRecord::Base.establish_connection end end
source share