summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-12 19:28:21 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-12 19:28:21 +0800
commit6597c213c341ae072216c125a97f94a174fc3dfa (patch)
tree99a1800a1593d68f31ed5210fc3a825503f63a8c /spec/models
parenta1eac5e4de95a4d27b30432c527ab410e9d77787 (diff)
downloadgitlab-ce-6597c213c341ae072216c125a97f94a174fc3dfa.tar.gz
Prefer empty relation rather than arrays
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/build_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index c7c247189f5..b1354faa722 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -697,5 +697,11 @@ describe Ci::Build, models: true do
expect(build_ids).to eq([build.id])
end
+
+ it 'returns empty relation if the build cannot be found' do
+ builds = project.builds_for(build.name, 'TAIL').all
+
+ expect(builds).to be_empty
+ end
end
end