diff options
Diffstat (limited to 'spec/lib/api/entities/job_request')
-rw-r--r-- | spec/lib/api/entities/job_request/image_spec.rb | 31 | ||||
-rw-r--r-- | spec/lib/api/entities/job_request/port_spec.rb | 22 |
2 files changed, 0 insertions, 53 deletions
diff --git a/spec/lib/api/entities/job_request/image_spec.rb b/spec/lib/api/entities/job_request/image_spec.rb deleted file mode 100644 index f13eab6a752..00000000000 --- a/spec/lib/api/entities/job_request/image_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe API::Entities::JobRequest::Image do - let(:ports) { [{ number: 80, protocol: 'http', name: 'name' }]} - let(:image) { double(name: 'image_name', entrypoint: ['foo'], ports: ports)} - let(:entity) { described_class.new(image) } - - subject { entity.as_json } - - it 'returns the image name' do - expect(subject[:name]).to eq 'image_name' - end - - it 'returns the entrypoint' do - expect(subject[:entrypoint]).to eq ['foo'] - end - - it 'returns the ports' do - expect(subject[:ports]).to eq ports - end - - context 'when the ports param is nil' do - let(:ports) { nil } - - it 'does not return the ports' do - expect(subject[:ports]).to be_nil - end - end -end diff --git a/spec/lib/api/entities/job_request/port_spec.rb b/spec/lib/api/entities/job_request/port_spec.rb deleted file mode 100644 index 4820c4a691b..00000000000 --- a/spec/lib/api/entities/job_request/port_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -# 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 |