summaryrefslogtreecommitdiff
path: root/spec/lib/api/entities/job_request/port_spec.rb
blob: 40ab4cd6231d9f626afaf7a0e4fb3cee25466639 (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'

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