From e56c305be003ee33b093f9ba42622fba0da903f2 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 18 Nov 2016 08:13:34 +0100 Subject: fix spec failures --- spec/lib/gitlab/cycle_analytics/code_event_spec.rb | 8 ++++---- spec/lib/gitlab/cycle_analytics/issue_event_spec.rb | 8 ++++---- spec/lib/gitlab/cycle_analytics/plan_event_spec.rb | 8 ++++---- spec/lib/gitlab/cycle_analytics/production_event_spec.rb | 2 +- spec/lib/gitlab/cycle_analytics/review_event_spec.rb | 2 +- spec/lib/gitlab/cycle_analytics/shared_event_spec.rb | 10 ++++++---- spec/lib/gitlab/cycle_analytics/staging_event_spec.rb | 8 ++++---- spec/lib/gitlab/cycle_analytics/test_event_spec.rb | 8 ++++---- 8 files changed, 28 insertions(+), 26 deletions(-) (limited to 'spec/lib/gitlab/cycle_analytics') diff --git a/spec/lib/gitlab/cycle_analytics/code_event_spec.rb b/spec/lib/gitlab/cycle_analytics/code_event_spec.rb index 7b854d7fea1..43f42d1bde8 100644 --- a/spec/lib/gitlab/cycle_analytics/code_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/code_event_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' require 'lib/gitlab/cycle_analytics/shared_event_spec' describe Gitlab::CycleAnalytics::CodeEvent do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).not_to eq(described_class.start_time_attrs) + it_behaves_like 'default query config' do + it 'does not have the default order' do + expect(event.order).not_to eq(event.start_time_attrs) + end end end diff --git a/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb b/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb index 2d7e7b1e0a5..1c5c308da7d 100644 --- a/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' require 'lib/gitlab/cycle_analytics/shared_event_spec' describe Gitlab::CycleAnalytics::IssueEvent do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) + it_behaves_like 'default query config' do + it 'has the default order' do + expect(event.order).to eq(event.start_time_attrs) + end end end diff --git a/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb b/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb index 3452c146584..d76a255acf5 100644 --- a/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' require 'lib/gitlab/cycle_analytics/shared_event_spec' describe Gitlab::CycleAnalytics::PlanEvent do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) + it_behaves_like 'default query config' do + it 'has the default order' do + expect(event.order).to eq(event.start_time_attrs) + end end end diff --git a/spec/lib/gitlab/cycle_analytics/production_event_spec.rb b/spec/lib/gitlab/cycle_analytics/production_event_spec.rb index 069c84efa09..6ee54f246a7 100644 --- a/spec/lib/gitlab/cycle_analytics/production_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/production_event_spec.rb @@ -5,6 +5,6 @@ describe Gitlab::CycleAnalytics::ProductionEvent do it_behaves_like 'default query config' it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) + expect(event.order).to eq(event.start_time_attrs) end end diff --git a/spec/lib/gitlab/cycle_analytics/review_event_spec.rb b/spec/lib/gitlab/cycle_analytics/review_event_spec.rb index e9aca82ecc9..890e3ab3078 100644 --- a/spec/lib/gitlab/cycle_analytics/review_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/review_event_spec.rb @@ -5,6 +5,6 @@ describe Gitlab::CycleAnalytics::ReviewEvent do it_behaves_like 'default query config' it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) + expect(event.order).to eq(event.start_time_attrs) end end diff --git a/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb b/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb index 1e76edce633..7019e4c3351 100644 --- a/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb @@ -1,19 +1,21 @@ require 'spec_helper' shared_examples 'default query config' do + let(:event) { described_class.new(project: double, options: {}) } + it 'has the start attributes' do - expect(described_class.start_time_attrs).not_to be_nil + expect(event.start_time_attrs).not_to be_nil end it 'has the stage attribute' do - expect(described_class.stage).not_to be_nil + expect(event.stage).not_to be_nil end it 'has the end attributes' do - expect(described_class.end_time_attrs).not_to be_nil + expect(event.end_time_attrs).not_to be_nil end it 'has the projection attributes' do - expect(described_class.projections).not_to be_nil + expect(event.projections).not_to be_nil end end diff --git a/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb b/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb index 9c1bec3edb1..4862d4765f2 100644 --- a/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' require 'lib/gitlab/cycle_analytics/shared_event_spec' describe Gitlab::CycleAnalytics::StagingEvent do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).not_to eq(described_class.start_time_attrs) + it_behaves_like 'default query config' do + it 'does not have the default order' do + expect(event.order).not_to eq(event.start_time_attrs) + end end end diff --git a/spec/lib/gitlab/cycle_analytics/test_event_spec.rb b/spec/lib/gitlab/cycle_analytics/test_event_spec.rb index 7238b9a34b3..e249db69fc6 100644 --- a/spec/lib/gitlab/cycle_analytics/test_event_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/test_event_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' require 'lib/gitlab/cycle_analytics/shared_event_spec' describe Gitlab::CycleAnalytics::TestEvent do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).not_to eq(described_class.start_time_attrs) + it_behaves_like 'default query config' do + it 'does not have the default order' do + expect(event.order).not_to eq(event.start_time_attrs) + end end end -- cgit v1.2.3