diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-04 22:32:03 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-04 22:32:03 +0200 |
commit | 62545ddb2c1552de84c7c5c2b3fdfa8ca2c38a67 (patch) | |
tree | d01a7c35b27eee20f0a8331bab9a98dd68ef45ad /spec/serializers/cluster_entity_spec.rb | |
parent | 07247601f3208fce65b3ac64ad3854dcc3dfd8c2 (diff) | |
download | gitlab-ce-62545ddb2c1552de84c7c5c2b3fdfa8ca2c38a67.tar.gz |
Add serializers tests
Diffstat (limited to 'spec/serializers/cluster_entity_spec.rb')
-rw-r--r-- | spec/serializers/cluster_entity_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/serializers/cluster_entity_spec.rb b/spec/serializers/cluster_entity_spec.rb new file mode 100644 index 00000000000..2c7f49974f1 --- /dev/null +++ b/spec/serializers/cluster_entity_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe ClusterEntity do + set(:cluster) { create(:gcp_cluster, :errored) } + let(:request) { double('request') } + + let(:entity) do + described_class.new(cluster) + end + + describe '#as_json' do + subject { entity.as_json } + + it 'contains status' do + expect(subject[:status]).to eq(:errored) + end + + it 'contains status reason' do + expect(subject[:status_reason]).to eq('general error') + end + end +end |