diff options
author | bikebilly <fabio@gitlab.com> | 2017-08-03 10:05:56 +0200 |
---|---|---|
committer | bikebilly <fabio@gitlab.com> | 2017-08-03 10:05:56 +0200 |
commit | 40dfddd4077da4d594bd9e8956e1fcb1c99434e6 (patch) | |
tree | d0761ed84471c22b3b0949720e3e0734e8645aac /spec/serializers/environment_serializer_spec.rb | |
parent | ed5445388de13f1d126fec14cc0a9ea9ae03b397 (diff) | |
parent | dc412b48693668f7fba3adea57b8be76685afa76 (diff) | |
download | gitlab-ce-40dfddd4077da4d594bd9e8956e1fcb1c99434e6.tar.gz |
Merge branch 'master' into 33329-tech-article-deploying-maven-artifacts
Diffstat (limited to 'spec/serializers/environment_serializer_spec.rb')
-rw-r--r-- | spec/serializers/environment_serializer_spec.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb index d2ad6c44702..ca9b520fb38 100644 --- a/spec/serializers/environment_serializer_spec.rb +++ b/spec/serializers/environment_serializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe EnvironmentSerializer do let(:user) { create(:user) } - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:json) do described_class @@ -39,7 +39,7 @@ describe EnvironmentSerializer do end context 'when there is a collection of objects provided' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:resource) { create_list(:environment, 2) } it 'contains important elements of environment' do @@ -62,7 +62,9 @@ describe EnvironmentSerializer do subject { serializer.represent(resource) } context 'when there is a single environment' do - before { create(:environment, name: 'staging') } + before do + create(:environment, name: 'staging') + end it 'represents one standalone environment' do expect(subject.count).to eq 1 @@ -138,7 +140,9 @@ describe EnvironmentSerializer do context 'when resource is paginatable relation' do context 'when there is a single environment object in relation' do - before { create(:environment) } + before do + create(:environment) + end it 'serializes environments' do expect(subject.first).to have_key :id @@ -146,7 +150,9 @@ describe EnvironmentSerializer do end context 'when multiple environment objects are serialized' do - before { create_list(:environment, 3) } + before do + create_list(:environment, 3) + end it 'serializes appropriate number of objects' do expect(subject.count).to be 2 |