2016-09-19 03:26:25 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe MergeRequest::Metrics, models: true do
|
2017-01-26 17:44:58 -05:00
|
|
|
subject { create(:merge_request) }
|
2016-09-19 03:26:25 -04:00
|
|
|
|
|
|
|
describe "when recording the default set of metrics on merge request save" do
|
|
|
|
it "records the merge time" do
|
|
|
|
time = Time.now
|
|
|
|
Timecop.freeze(time) { subject.mark_as_merged }
|
|
|
|
metrics = subject.metrics
|
|
|
|
|
|
|
|
expect(metrics).to be_present
|
2016-10-17 08:40:02 -04:00
|
|
|
expect(metrics.merged_at).to be_like_time(time)
|
2016-09-19 03:26:25 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|