2016-09-29 09:46:39 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe MergeRequest::Metrics do
|
2017-08-17 22:00:37 +05:30
|
|
|
subject { create(:merge_request) }
|
2016-09-29 09:46:39 +05:30
|
|
|
|
|
|
|
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-11-03 12:29:30 +05:30
|
|
|
expect(metrics.merged_at).to be_like_time(time)
|
2016-09-29 09:46:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|