engines/registry/spec/requests/api/connect/v3/systems/activations_controller_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage
describe Api::Connect::V3::Systems::ActivationsController, type: :request do
  include_context 'auth header', :system, :login, :password
  include_context 'version header', 3

  describe '#activations' do
    let(:system) { FactoryBot.create(:system, :with_activated_product) }
    let(:headers) { auth_header.merge(version_header) }

    before do
      headers['X-Registry'] = 'foo'
      allow(Dir).to receive(:mkdir)
      allow(FileUtils).to receive(:touch)
      get '/connect/systems/activations', headers: headers
    end

    context 'without X-Instance-Data headers or hw_info' do
      it 'has service URLs with HTTP scheme' do
        data = JSON.parse(response.body)
        expect(data[0]['service']['url']).to match(%r{^plugin:/susecloud})
      end
    end
  end
end