Project

General

Profile

Revision f6a9acbd

Added by Sebastian Gräßl over 5 years ago

Fixes #18518 - Add proper validation for container image

For now the image has only been validate via the result
of the search, but not enforced on the server side.

The model validation brings now proper feedback when
the form has been submitted to the server.

View differences:

test/units/containers_service_test.rb
3 3

  
4 4
class ContainersServiceTest < ActiveSupport::TestCase
5 5
  setup do
6
    stub_image_existance
7
    stub_registry_api
8

  
6 9
    @state = DockerContainerWizardState.create! do |s|
7 10
      s.build_preliminary(:compute_resource_id => FactoryGirl.create(:docker_cr).id,
8 11
                          :locations           => [taxonomies(:location1)],
9 12
                          :organizations       => [taxonomies(:organization1)])
10
      s.build_image(:repository_name => 'test', :tag => 'test')
13
      s.build_image(:repository_name => 'test', :tag => 'test', :wizard_state => s)
11 14
      s.build_configuration(:name => 'test', :command => '/bin/bash')
12 15
      s.build_environment(:tty => false)
13 16
    end

Also available in: Unified diff