summaryrefslogtreecommitdiff
path: root/spec/models/ci
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2017-10-06 12:33:10 +0200
committerAlessio Caiazza <acaiazza@gitlab.com>2017-10-06 12:33:10 +0200
commitc0cfc9ebd26583c444f2cce1a23f939bfa7d8969 (patch)
treea6e7260211e51b0286afc7cca7b11e985621d5c1 /spec/models/ci
parentea023138bf5116a729e5accd5f81d4e586af6b02 (diff)
downloadgitlab-ce-c0cfc9ebd26583c444f2cce1a23f939bfa7d8969.tar.gz
Extract `Ci::Build#parse_trace_sections!` into a service37970-ci-sections-tracking
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/build_spec.rb23
1 files changed, 6 insertions, 17 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 7fe12f92a2a..06f76b5501e 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -322,24 +322,13 @@ describe Ci::Build do
end
describe '#parse_trace_sections!' do
- context "when the build trace has sections markers," do
- before do
- build.trace.set(File.read(expand_fixture_path('trace/trace_with_sections')))
- end
-
- it "saves the correct extracted sections" do
- expect(build.trace_sections).to be_empty
- expect(build.parse_trace_sections!).to be(true)
- expect(build.trace_sections).not_to be_empty
- end
-
- it "fails if trace_sections isn't empty" do
- expect(build.parse_trace_sections!).to be(true)
- expect(build.trace_sections).not_to be_empty
+ it 'calls ExtractSectionsFromBuildTraceService' do
+ expect(Ci::ExtractSectionsFromBuildTraceService)
+ .to receive(:new).with(project, build.user).once.and_call_original
+ expect_any_instance_of(Ci::ExtractSectionsFromBuildTraceService)
+ .to receive(:execute).with(build).once
- expect(build.parse_trace_sections!).to be(false)
- expect(build.trace_sections).not_to be_empty
- end
+ build.parse_trace_sections!
end
end