summaryrefslogtreecommitdiff
path: root/spec/lib/api/entities/job_request/port_spec.rb
blob: 4820c4a691bbe086b372a078f8c75f79f3d64711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ::API::Entities::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