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