Fix invalid assertions in build details entity specs

This commit is contained in:
Grzegorz Bizon 2017-07-20 11:42:13 +02:00
parent c9749e2238
commit 70489d08b7
2 changed files with 5 additions and 6 deletions

View File

@ -140,7 +140,6 @@ FactoryGirl.define do
end end
trait :erased do trait :erased do
erasable
erased_at Time.now erased_at Time.now
erased_by factory: :user erased_by factory: :user
end end

View File

@ -87,18 +87,18 @@ describe BuildDetailsEntity do
end end
end end
context 'when the build has been erased' do context 'when the build has not been erased' do
let(:build) { create(:ci_build, :erased, project: project) } 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) expect(subject).to include(:erase_path)
end end
end end
context 'when the build has been erased' do 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) expect(subject).to include(:erased_by)
end end
end end