From 70489d08b7e8b4bd0ba566da2ed0e417bef3ed3e Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 20 Jul 2017 11:42:13 +0200 Subject: [PATCH] Fix invalid assertions in build details entity specs --- spec/factories/ci/builds.rb | 1 - spec/serializers/build_details_entity_spec.rb | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 863c82ece6a..a77f01ecb00 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -140,7 +140,6 @@ FactoryGirl.define do end trait :erased do - erasable erased_at Time.now erased_by factory: :user end diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb index 2c981154f0d..446a2451956 100644 --- a/spec/serializers/build_details_entity_spec.rb +++ b/spec/serializers/build_details_entity_spec.rb @@ -87,18 +87,18 @@ describe BuildDetailsEntity do end end - context 'when the build has been erased' do - let(:build) { create(:ci_build, :erased, project: project) } + context 'when the build has not been erased' do + let(:build) { create(:ci_build, :erasable, project: project) } - it 'exposes the user whom erased the build' do + it 'exposes a build erase path' do expect(subject).to include(:erase_path) end end context 'when the build has been erased' do - let(:build) { create(:ci_build, :erased, project: project, erased_by: user) } + let(:build) { create(:ci_build, :erased, project: project) } - it 'exposes the user whom erased the build' do + it 'exposes the user who erased the build' do expect(subject).to include(:erased_by) end end