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 18:30:38 +0300
committerJames Lopez <james@jameslopez.es>2016-11-17 10:22:55 +0300
commit3cdc9af78ebb71e2b91046e9dea8695aa04f6713 (patch)
tree22122f8bd8928afd399f5640aefdcfa464470c82 /spec/lib/gitlab/cycle_analytics
parent275292de4768ab9893d9d786b9fbb72bf173ba3c (diff)
added production events and related spec
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
-rw-r--r--spec/lib/gitlab/cycle_analytics/events_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb
index 0212ce60b92..410310d3029 100644
--- a/spec/lib/gitlab/cycle_analytics/events_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb
@@ -149,6 +149,35 @@ describe Gitlab::CycleAnalytics::Events do
end
end
+ describe '#production_events' do
+ let!(:context) { create(:issue, project: project, created_at: 2.days.ago) }
+
+ before do
+ merge_merge_requests_closing_issue(context)
+ deploy_master
+ end
+
+ it 'has the total time' do
+ expect(subject.production_events.first['total_time']).to eq('2 days')
+ end
+
+ it 'has a title' do
+ expect(subject.production_events.first['title']).to eq(context.title)
+ end
+
+ it 'has an iid' do
+ expect(subject.production_events.first['iid']).to eq(context.iid.to_s)
+ end
+
+ it 'has a created_at timestamp' do
+ expect(subject.production_events.first['created_at']).to end_with('ago')
+ end
+
+ it "has the author's name" do
+ expect(subject.production_events.first['name']).to eq(context.author.name)
+ end
+ end
+
def setup(context)
milestone = create(:milestone, project: project)
context.update(milestone: milestone)