Sha256: c04019683ec8c6cb1108c2d64f85d99ca1683a17693c7f31343908ff4e8693f4

Contents?: true

Size: 749 Bytes

Versions: 6

Compression:

Stored size: 749 Bytes

Contents

require 'spec_helper'

describe 'A status request with an ActiveRecordCheck' do
  before do
    Rapporteur.add_check(Rapporteur::Checks::ActiveRecordCheck)
  end

  subject { get(status_path) ; response }

  context 'with an unerring ActiveRecord connection' do
    it_behaves_like 'a successful status response'
  end

  context 'with a failed ActiveRecord connection' do
    before do
      ActiveRecord::Base.connection.stub(:execute).
        and_raise(ActiveRecord::ConnectionNotEstablished)
    end

    it_behaves_like 'an erred status response'

    it 'contains a message regarding the database failure' do
      expect(subject).to include_status_error_message(:database, I18n.t('rapporteur.errors.database.unavailable'))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rapporteur-3.0.2 spec/requests/active_record_check_spec.rb
rapporteur-3.0.1 spec/requests/active_record_check_spec.rb
rapporteur-3.0.0 spec/requests/active_record_check_spec.rb
rapporteur-2.1.0 spec/requests/active_record_check_spec.rb
rapporteur-2.0.1 spec/requests/active_record_check_spec.rb
rapporteur-2.0.0 spec/requests/active_record_check_spec.rb