BigW Consortium Gitlab

Commit 53fe06ef by Grzegorz Bizon

Update ci commit pipeline specs according to changes

parent 0d19abf4
...@@ -346,9 +346,9 @@ describe Ci::Commit, models: true do ...@@ -346,9 +346,9 @@ describe Ci::Commit, models: true do
end end
end end
describe '#update_state' do describe '#update_state!' do
it 'execute update_state after touching object' do it 'execute update_state! after touching object' do
expect(commit).to receive(:update_state).and_return(true) expect(commit).to receive(:update_state!).and_return(true)
commit.touch commit.touch
end end
...@@ -356,17 +356,17 @@ describe Ci::Commit, models: true do ...@@ -356,17 +356,17 @@ describe Ci::Commit, models: true do
let(:commit_status) { build :commit_status, commit: commit } let(:commit_status) { build :commit_status, commit: commit }
it 'execute update_state after saving dependent object' do it 'execute update_state after saving dependent object' do
expect(commit).to receive(:update_state).and_return(true) expect(commit).to receive(:update_state!).and_return(true)
commit_status.save commit_status.save
end end
end end
context 'update state' do context 'update state' do
let(:current) { Time.now.change(usec: 0) } let(:current) { Time.now.change(usec: 0) }
let(:build) { FactoryGirl.create :ci_build, :success, commit: commit, started_at: current - 120, finished_at: current - 60 } let!(:build) do
create :ci_build, :success, commit: commit,
before do started_at: current - 120,
build finished_at: current - 60
end end
[:status, :started_at, :finished_at, :duration].each do |param| [:status, :started_at, :finished_at, :duration].each do |param|
......
...@@ -183,7 +183,7 @@ describe CreateCommitBuildsService, services: true do ...@@ -183,7 +183,7 @@ describe CreateCommitBuildsService, services: true do
ref: 'refs/heads/master', ref: 'refs/heads/master',
before: '00000000', before: '00000000',
after: '31das312', after: '31das312',
commits: [{ message: 'some msg'} ]) commits: [{ message: 'some msg' }])
expect(result).to be false expect(result).to be false
expect(Ci::Build.all).to be_empty expect(Ci::Build.all).to be_empty
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment