Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-10-21 12:33:37 +0300
committerJames Lopez <james@jameslopez.es>2016-11-17 10:22:55 +0300
commit1f701cb5e2fc9ea3af98ab0e6e07a7568a0e54dc (patch)
treeeccc2c127d5c43807991746f64962a4d7be334a6 /spec/lib/gitlab/cycle_analytics
parentf8acc7ea77bb52531b11abea5eabd68a38236cff (diff)
added staging events and spec
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
-rw-r--r--spec/lib/gitlab/cycle_analytics/events_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb
index 17db46f0d4a..0212ce60b92 100644
--- a/spec/lib/gitlab/cycle_analytics/events_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb
@@ -123,6 +123,32 @@ describe Gitlab::CycleAnalytics::Events do
end
end
+ describe '#staging_events' do
+ let!(:context) { create(:issue, project: project, created_at: 2.days.ago) }
+ let(:merge_request) { MergeRequest.first }
+ let!(:pipeline) do
+ create(:ci_pipeline,
+ ref: merge_request.source_branch,
+ sha: merge_request.diff_head_sha,
+ project: context.project)
+ end
+
+ before do
+ pipeline.run!
+ pipeline.succeed!
+ merge_merge_requests_closing_issue(context)
+ deploy_master
+ end
+
+ it 'has the build info as a pipeline' do
+ expect(subject.staging_events.first['pipeline']).to eq(pipeline)
+ end
+
+ it 'has the total time' do
+ expect(subject.staging_events.first['total_time']).to eq('less than a minute')
+ end
+ end
+
def setup(context)
milestone = create(:milestone, project: project)
context.update(milestone: milestone)