summaryrefslogtreecommitdiff
path: root/spec/serializers/cluster_entity_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-10-04 22:32:03 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-10-04 22:32:03 +0200
commit62545ddb2c1552de84c7c5c2b3fdfa8ca2c38a67 (patch)
treed01a7c35b27eee20f0a8331bab9a98dd68ef45ad /spec/serializers/cluster_entity_spec.rb
parent07247601f3208fce65b3ac64ad3854dcc3dfd8c2 (diff)
downloadgitlab-ce-62545ddb2c1552de84c7c5c2b3fdfa8ca2c38a67.tar.gz
Add serializers tests
Diffstat (limited to 'spec/serializers/cluster_entity_spec.rb')
-rw-r--r--spec/serializers/cluster_entity_spec.rb22
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