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-11-04 13:56:24 +0300
committerJames Lopez <james@jameslopez.es>2016-11-17 10:22:57 +0300
commiteccb6a5e920920bda11104ca608e652f84a944bf (patch)
treebbe4c84faf28be3e7f73fb3ccffa8aae9b3f246d /spec/lib/gitlab/cycle_analytics
parent11bad33a4206e482ffac42d75a121182a52e0cb0 (diff)
Refactored test events
Now test events return the builds instead a list of pipelines to avoid calling pipeline.builds per each and get the info. Also, added missing fields/data, URLs, and fixed specs in events spec.
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
-rw-r--r--spec/lib/gitlab/cycle_analytics/events_spec.rb37
1 files changed, 34 insertions, 3 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb
index 32e7bd7b12c..c83dafbd256 100644
--- a/spec/lib/gitlab/cycle_analytics/events_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb
@@ -112,16 +112,47 @@ describe Gitlab::CycleAnalytics::Events do
end
before do
+ create(:ci_build, pipeline: pipeline, status: :success)
+ create(:ci_build, pipeline: pipeline, status: :success)
+
pipeline.run!
pipeline.succeed!
end
- it 'has the build info as a pipeline' do
- expect(subject.test_events.first['pipeline']).to eq(pipeline)
+ it 'has the name' do
+ expect(subject.test_events.first['name']).not_to be_nil
+ end
+
+ it 'has the ID' do
+ expect(subject.test_events.first['id']).not_to be_nil
+ end
+
+ it 'has the URL' do
+ expect(subject.test_events.first['url']).not_to be_nil
+ end
+
+ it 'has the branch name' do
+ expect(subject.test_events.first['branch']).not_to be_nil
+ end
+
+ it 'has the branch URL' do
+ expect(subject.test_events.first['branch_url']).not_to be_nil
+ end
+
+ it 'has the short SHA' do
+ expect(subject.test_events.first['sha']).not_to be_nil
+ end
+
+ it 'has the commit URL' do
+ expect(subject.test_events.first['commit_url']).not_to be_nil
+ end
+
+ it 'has the date' do
+ expect(subject.test_events.first['date']).not_to be_nil
end
it 'has the total time' do
- expect(subject.test_events.first['total_time']).to eq('less than a minute')
+ expect(subject.test_events.first['total_time']).not_to be_nil
end
end