debian-mirror-gitlab/spec/lib/api/entities/ci/job_request/port_spec.rb
2021-09-30 23:02:18 +05:30

22 lines
504 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ::API::Entities::Ci::JobRequest::Port do
let(:port) { double(number: 80, protocol: 'http', name: 'name')}
let(:entity) { described_class.new(port) }
subject { entity.as_json }
it 'returns the port number' do
expect(subject[:number]).to eq 80
end
it 'returns if the port protocol' do
expect(subject[:protocol]).to eq 'http'
end
it 'returns the port name' do
expect(subject[:name]).to eq 'name'
end
end