Commit 232ae06a authored by Sean McGivern's avatar Sean McGivern

Merge branch 'sh-fix-ee-issue-8871' into 'master'

Fix failing test in spec/workers/post_receive_spec.rb

Closes gitlab-ee#8871

See merge request gitlab-org/gitlab-ce!24993
parents c8fe0d6a 28c48804
...@@ -141,13 +141,20 @@ describe PostReceive do ...@@ -141,13 +141,20 @@ describe PostReceive do
let(:gl_repository) { "wiki-#{project.id}" } let(:gl_repository) { "wiki-#{project.id}" }
it 'updates project activity' do it 'updates project activity' do
described_class.new.perform(gl_repository, key_id, base64_changes) # Force Project#set_timestamps_for_create to initialize timestamps
project
expect { project.reload } # MySQL drops milliseconds in the timestamps, so advance at least
.to change(project, :last_activity_at) # a second to ensure we see changes.
Timecop.freeze(1.second.from_now) do
expect do
described_class.new.perform(gl_repository, key_id, base64_changes)
project.reload
end.to change(project, :last_activity_at)
.and change(project, :last_repository_updated_at) .and change(project, :last_repository_updated_at)
end end
end end
end
context "webhook" do context "webhook" do
it "fetches the correct project" do it "fetches the correct project" do
......
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