travis-api/spec/integration/uptime_spec.rb
2016-06-19 14:35:54 +02:00

19 lines
527 B
Ruby

describe 'Uptime', set_app: true do
after do
ActiveRecord::Base.connection.unstub(:execute)
end
it 'returns a 200 and ok when the request was successful' do
response = get '/uptime'
response.status.should == 200
response.body.should == "OK"
end
it "returns a 500 when the query wasn't successful" do
ActiveRecord::Base.connection.stubs(:execute).raises(StandardError, 'error!')
response = get '/uptime'
response.status.should == 500
response.body.should == "Error: error!"
end
end