Fix failing test in spec/workers/post_receive_spec.rb
This is what was happening before:
-
Project#set_timestamps_for_create
was called at creation time and set thelast_activity_at
andlast_repository_updated_at
to the current timestamp T. -
The test ran
PostReceive#perform
, which then calledPostReceive#process_wiki_changes
. If less than 500 milliseconds elapsed since T, then the update would just set the timestamp to T.
To fix this problem, we can just use Timecop to ensure at least one second has elapsed after attempting to process changes.