summaryrefslogtreecommitdiff
path: root/spec/serializers/cluster_serializer_spec.rb
blob: a6dd23096630b453bab5be04c128a0a5d881df2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'spec_helper'

describe ClusterSerializer do
  describe '#represent_status' do
    subject { described_class.new.represent_status(cluster) }

    context 'when provider type is gcp' do
      let(:cluster) { create(:cluster, provider_type: :gcp, provider_gcp: provider) }
      let(:provider) { create(:provider_gcp, :errored) }

      it 'serializes only status' do
        expect(subject.keys).to contain_exactly(:status, :status_reason, :applications)
      end
    end

    context 'when provider type is user' do
      let(:cluster) { create(:cluster, provider_type: :user) }

      it 'serializes only status' do
        expect(subject.keys).to contain_exactly(:status, :status_reason, :applications)
      end
    end
  end
end