Sha256: 22a282ebf1f593bffabb6176d524a7f1fd6b74b60eb81a04df2022718bb44282

Contents?: true

Size: 963 Bytes

Versions: 2

Compression:

Stored size: 963 Bytes

Contents

require 'rails_helper'

module MnoEnterprise
  describe StatusController, type: :controller do
    routes { MnoEnterprise::Engine.routes }

    describe 'GET #ping' do
      before { get :ping }

      it { is_expected.to respond_with(200) }
      it { expect(response.body).to eq({status: 'Ok'}.to_json) }
    end

    describe 'GET #version' do
      before { get :version }
      let(:data) { JSON.parse(response.body) }

      it { is_expected.to respond_with(200) }

      it 'returns the main app version' do
        expect(data['app-version']).to eq(MnoEnterprise::APP_VERSION)
      end

      it 'returns the mnoe-version' do
        expect(data['mno-enteprise-version']).to eq(MnoEnterprise::VERSION)
      end

      it 'returns the environment' do
        expect(data['env']).to eq('test')
      end

      it 'returns the mno-api-host' do
        expect(data['mno-api-host']).to eq('https://api-enterprise.maestrano.com')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mno-enterprise-api-3.4.0 spec/controllers/mno_enterprise/status_controller_spec.rb
mno-enterprise-api-3.3.3 spec/controllers/mno_enterprise/status_controller_spec.rb