require_relative '../../../../spec_helper'

describe 'govuk_jenkins::config', :type => :class do
  describe 'manage config' do
    let(:hiera_data) {{
      'govuk_jenkins::config::github_client_id' => 'bar',
      'govuk_jenkins::config::github_client_secret' => 'baz',
    }}

    context 'false (default)' do
      let (:params) {{
        :manage_config => false,
      }}

      it { should_not contain_file('/var/lib/jenkins/config.xml') }
    end

    context 'true' do
      let (:params) {{
        :manage_config => true,
      }}

      it { should contain_file('/var/lib/jenkins/config.xml')
          .with_content(/foo/)
          .with_content(/bar/)
      }
    end
  end
end

require_relative '../../../../spec_helper'

describe 'govuk_jenkins::config', :type => :class do
  describe 'manage config' do
    let(:hiera_data) {{
      'govuk_jenkins::config::github_client_id' => 'bar',
      'govuk_jenkins::config::github_client_secret' => 'baz',
    }}

    context 'false (default)' do
      let (:params) {{
        :manage_config => false,
      }}

      it { should_not contain_file('/var/lib/jenkins/config.xml') }
    end

    context 'true' do
      let (:params) {{
        :manage_config => true,
      }}

      it { should contain_file('/var/lib/jenkins/config.xml') }
    end
  end
end

Remove content check for Jenkins config.xml
Remove content check for Jenkins config.xml

Remove the two tests for the contents of the managed `config.xml` file.

We should have tests to verify that the contents are being set
correctly, but I don't think these tests are helpful as they don't check
which configuration parameter is being set; any occurrence of 'foo' or
'bar' in the file would cause the tests to pass.
