gitlab-org--gitlab-foss/spec/serializers/cluster_serializer_spec.rb

27 lines
781 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-10-04 20:32:03 +00:00
require 'spec_helper'
describe ClusterSerializer do
describe '#represent_status' do
2017-10-30 16:03:58 +00:00
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(:cluster_provider_gcp, :errored) }
2017-10-30 16:03:58 +00:00
it 'serializes only status' do
2017-11-06 16:02:28 +00:00
expect(subject.keys).to contain_exactly(:status, :status_reason, :applications)
2017-10-30 16:03:58 +00:00
end
end
2017-10-04 20:32:03 +00:00
2017-10-30 16:03:58 +00:00
context 'when provider type is user' do
let(:cluster) { create(:cluster, provider_type: :user) }
2017-10-04 20:32:03 +00:00
it 'serializes only status' do
2017-10-31 10:29:56 +00:00
expect(subject.keys).to contain_exactly(:status, :status_reason, :applications)
2017-10-04 20:32:03 +00:00
end
end
end
end