diff --git a/spec/controllers/ping_controller_spec.rb b/spec/controllers/ping_controller_spec.rb new file mode 100644 index 000000000..dfa381838 --- /dev/null +++ b/spec/controllers/ping_controller_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe PingController, type: :controller do + describe 'GET #index' do + + subject { get :index } + + it { expect(subject.status).to eq 200 } + + context 'when base is un-plug' do + + before do + allow(ActiveRecord::Base).to receive(:connected?).and_return(false) + end + + it { expect(subject.status).to eq 500 } + end + end +end \ No newline at end of file