2018-03-01 18:46:02 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Kubernetes::ConfigMap do
|
|
|
|
let(:kubeclient) { double('kubernetes client') }
|
|
|
|
let(:application) { create(:clusters_applications_prometheus) }
|
2018-08-07 08:39:38 -04:00
|
|
|
let(:config_map) { described_class.new(application.name, application.files) }
|
2018-03-01 18:46:02 -05:00
|
|
|
let(:namespace) { Gitlab::Kubernetes::Helm::NAMESPACE }
|
|
|
|
|
|
|
|
let(:metadata) do
|
|
|
|
{
|
|
|
|
name: "values-content-configuration-#{application.name}",
|
|
|
|
namespace: namespace,
|
|
|
|
labels: { name: "values-content-configuration-#{application.name}" }
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#generate' do
|
2018-08-07 08:39:38 -04:00
|
|
|
let(:resource) { ::Kubeclient::Resource.new(metadata: metadata, data: application.files) }
|
2018-03-01 18:46:02 -05:00
|
|
|
subject { config_map.generate }
|
|
|
|
|
|
|
|
it 'should build a Kubeclient Resource' do
|
|
|
|
is_expected.to eq(resource)
|
|
|
|
end
|
|
|
|
end
|
2018-06-25 05:57:29 -04:00
|
|
|
|
|
|
|
describe '#config_map_name' do
|
|
|
|
it 'returns the config_map name' do
|
|
|
|
expect(config_map.config_map_name).to eq("values-content-configuration-#{application.name}")
|
|
|
|
end
|
|
|
|
end
|
2018-03-01 18:46:02 -05:00
|
|
|
end
|