summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-10-21 17:30:38 +0200
committerJames Lopez <james@jameslopez.es>2016-11-17 08:22:55 +0100
commit3cdc9af78ebb71e2b91046e9dea8695aa04f6713 (patch)
tree22122f8bd8928afd399f5640aefdcfa464470c82 /spec
parent275292de4768ab9893d9d786b9fbb72bf173ba3c (diff)
downloadgitlab-ce-3cdc9af78ebb71e2b91046e9dea8695aa04f6713.tar.gz
added production events and related spec
Diffstat (limited to 'spec')
-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)