# encoding: UTF-8
#
# Author:: Xabier de Zuazo (<xabier@zuazo.org>)
# Copyright:: Copyright (c) 2015-2016 Xabier de Zuazo
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'spec_helper'

describe 'Build a Dockerfile from a tag' do
  context docker_build(id: 'nginx:1', tag: 'from_tag_spec') do
    context docker_run('from_tag_spec') do
      describe package('nginx') do
        it { should be_installed }
      end

      it 'is a Linux distro' do
        expect(command('uname').stdout).to include 'Linux'
      end

      describe server(described_container) do
        describe http('/') do
          it 'responds content including "Welcome to nginx!"' do
            expect(response.body).to include 'Welcome to nginx!'
          end

          it 'responds as "nginx" server' do
            expect(response.headers['server']).to match(/nginx/i)
          end
        end
      end
    end
  end
end

# encoding: UTF-8
#
# Author:: Xabier de Zuazo (<xabier@zuazo.org>)
# Copyright:: Copyright (c) 2015-2016 Xabier de Zuazo
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'spec_helper'

describe 'Build a Dockerfile from a tag' do
  context docker_build(id: 'nginx:1.9', tag: 'from_tag_spec') do
    context docker_run('from_tag_spec') do
      describe package('nginx') do
        it { should be_installed }
      end

      it 'is a Linux distro' do
        expect(command('uname').stdout).to include 'Linux'
      end

      describe server(described_container) do
        describe http('/') do
          it 'responds content including "Welcome to nginx!"' do
            expect(response.body).to include 'Welcome to nginx!'
          end

          it 'responds as "nginx" server' do
            expect(response.headers['server']).to match(/nginx/i)
          end
        end
      end
    end
  end
end

Fix *Multiple IDs found with provided prefix* error
Fix *Multiple IDs found with provided prefix* error
