BigW Consortium Gitlab

version_spec.rb 631 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe API::Version do
4 5 6 7 8
  describe 'GET /version' do
    context 'when unauthenticated' do
      it 'returns authentication error' do
        get api('/version')

9
        expect(response).to have_gitlab_http_status(401)
10 11 12 13 14 15 16 17 18
      end
    end

    context 'when authenticated' do
      let(:user) { create(:user) }

      it 'returns the version information' do
        get api('/version', user)

19
        expect(response).to have_gitlab_http_status(200)
20 21 22 23 24 25
        expect(json_response['version']).to eq(Gitlab::VERSION)
        expect(json_response['revision']).to eq(Gitlab::REVISION)
      end
    end
  end
end