diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-09-18 10:56:04 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-09-18 10:56:04 -0500 |
commit | 57c97a10b0574a7fba14ef408ee0fbda1f96c646 (patch) | |
tree | cec79cb6506fe0bfa6347f29174794858ec57fad /spec/models/ci/pipeline_spec.rb | |
parent | 14a932f18094c2826cf958ff110075e32c18d684 (diff) | |
parent | 4cadf22e208e3be401824f43ab13d5e6f2ff6465 (diff) | |
download | gitlab-ce-57c97a10b0574a7fba14ef408ee0fbda1f96c646.tar.gz |
Merge branch 'master' into 37220-es-modules
* master: (148 commits)
Remove gaps under nav on build page
Replace the 'project/snippets.feature' spinach test with an rspec analog
Use correct group members path for members flyout link
Replace the 'project/commits/revert.feature' spinach test with an rspec analog
Merge branch 'rs-incoming-email-domain-docs' into 'security-10-0'
Replace the 'project/archived.feature' spinach test with an rspec analog
Fix broken link in docs/api/wiki.md
Fixed the new sidebars width when browser has scrollbars
Improve 'spec/features/profiles/*' specs
Replace the 'search.feature' spinach test with an rspec analog
dedupe yarn packages
add dependency approvals (all MIT license)
update build image to latest with node 8.x, yarn 1.0.2, and chrome 61
Ensure we use `Entities::User` for non-admin `users/:id` API requests
Minor update to address Sean McGivern's comment.
Add data migration
Fix setting share_with_group_lock
created services for keys
Prepare Repository#merge for migration to Gitaly
Never connect to webpack-dev-server over SSL
...
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 95da97b7bc5..77f0be6b120 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1439,4 +1439,24 @@ describe Ci::Pipeline, :mailer do it_behaves_like 'not sending any notification' end end + + describe '#latest_builds_with_artifacts' do + let!(:pipeline) { create(:ci_pipeline, :success) } + + let!(:build) do + create(:ci_build, :success, :artifacts, pipeline: pipeline) + end + + it 'returns the latest builds' do + expect(pipeline.latest_builds_with_artifacts).to eq([build]) + end + + it 'memoizes the returned relation' do + query_count = ActiveRecord::QueryRecorder + .new { 2.times { pipeline.latest_builds_with_artifacts.to_a } } + .count + + expect(query_count).to eq(1) + end + end end |