travis-api/spec/integration/uptime_spec.rb
2013-08-26 17:29:10 +02:00

21 lines
535 B
Ruby

require 'spec_helper'
describe 'Uptime' 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