diff options
author | Leandro Camargo <leandroico@gmail.com> | 2016-12-06 02:39:59 -0200 |
---|---|---|
committer | Leandro Camargo <leandroico@gmail.com> | 2017-01-25 01:07:44 -0200 |
commit | f8bec0d1fb05d2c3e87a0470579ee7a650ade23c (patch) | |
tree | 028fc0ef685c0ef7d33c6c80982a3d52d2e5505d /spec/models/ci | |
parent | 6323cd7203dbf1850e7939e81db4b1a9c6cf6d76 (diff) | |
download | gitlab-ce-f8bec0d1fb05d2c3e87a0470579ee7a650ade23c.tar.gz |
Improve specs styles/organization and add some more specs
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/build_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 7baaef9c85e..52cc45f07b2 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -251,12 +251,13 @@ describe Ci::Build, :models do end describe '#update_coverage' do - it 'grants coverage_regex method is called inside of it' do - build.coverage_regex = '\(\d+.\d+\%\) covered' - allow(build).to receive(:trace) { 'Coverage 1033 / 1051 LOC (98.29%) covered' } - allow(build).to receive(:coverage_regex).and_call_original - expect(build).to receive(:update_attributes).with(coverage: 98.29) { true } - expect(build.update_coverage).to be true + context "regarding coverage_regex's value," do + it "saves the correct extracted coverage value" do + build.coverage_regex = '\(\d+.\d+\%\) covered' + allow(build).to receive(:trace) { 'Coverage 1033 / 1051 LOC (98.29%) covered' } + expect(build).to receive(:update_attributes).with(coverage: 98.29) { true } + expect(build.update_coverage).to be true + end end end |