Project

General

Profile

Revision 9ea40591

Added by Daniel Lobato Garcia over 6 years ago

Fixes #14181 - Validate registry URL and attempt login

In order to avoid users trying to create containers in an external
registry that doesn't exist, we should provide some preventative
measures.

View differences:

test/functionals/api/v2/registries_controller_test.rb
24 24

  
25 25
      test 'creates a new registry with valid params' do
26 26
        docker_attrs = FactoryGirl.attributes_for(:docker_registry)
27
        DockerRegistry.any_instance.stubs(:attempt_login)
27 28
        post :create, :registry => docker_attrs
28 29
        assert_response :success
29 30
      end
......
41 42
      end
42 43

  
43 44
      test 'update a docker registry' do
45
        DockerRegistry.any_instance.stubs(:attempt_login)
44 46
        put :update, :id => @registry.id, :registry => { :name => 'hello_world' }
45 47
        assert_response :success
46 48
        assert DockerRegistry.exists?(:name => 'hello_world')

Also available in: Unified diff