summaryrefslogtreecommitdiff
path: root/spec/models/deployment_cluster_spec.rb
blob: dc9cbe4b082037b1e36805b0c0a7c7305aa64a89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe DeploymentCluster do
  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