2020-02-10 07:08:59 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe DeploymentCluster do
|
2020-02-10 07:08:59 -05:00
|
|
|
let(:cluster) { create(:cluster) }
|
|
|
|
let(:deployment) { create(:deployment) }
|
|
|
|
let(:kubernetes_namespace) { 'an-example-namespace' }
|
|
|
|
|
|
|
|
subject { described_class.new(deployment: deployment, cluster: cluster, kubernetes_namespace: kubernetes_namespace) }
|
|
|
|
|
|
|
|
it { is_expected.to belong_to(:deployment).required }
|
|
|
|
it { is_expected.to belong_to(:cluster).required }
|
|
|
|
|
|
|
|
it do
|
|
|
|
is_expected.to have_attributes(
|
|
|
|
cluster_id: cluster.id,
|
|
|
|
deployment_id: deployment.id,
|
|
|
|
kubernetes_namespace: kubernetes_namespace
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|