Project

General

Profile

Revision 10546a55

Added by Daniel Lobato Garcia over 6 years ago

Fixes #15098 - Scope registry by taxonomies

View differences:

app/models/docker_registry.rb
3 3
  include Taxonomix
4 4
  include Encryptable
5 5

  
6
  default_scope do
7
    with_taxonomy_scope do
8
      order('docker_registries.name')
9
    end
10
  end
11

  
6 12
  has_many :containers, :foreign_key => "registry_id", :dependent => :destroy
7 13
  encrypts :password
8 14

  
test/functionals/api/v2/containers_controller_test.rb
46 46
          end
47 47

  
48 48
          test 'delete removes a container in foreman and in Docker host' do
49
            Fog.mock!
49 50
            delete :destroy, :id => @container.id
51
            Fog.unmock!
50 52
            assert_response :success
51 53
            assert_equal ActiveSupport::JSON.decode(response.body)['name'], 'foo'
52 54
          end

Also available in: Unified diff