diff options
author | James Lopez <james@jameslopez.es> | 2016-11-18 08:13:34 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-18 08:13:34 +0100 |
commit | e56c305be003ee33b093f9ba42622fba0da903f2 (patch) | |
tree | 03165847694615ccdd2709a6f07d8032ba7f2bbd /spec/lib/gitlab/cycle_analytics | |
parent | 24c2aa39ad0f55321ef2c28ce10d740bf6b78980 (diff) | |
download | gitlab-ce-e56c305be003ee33b093f9ba42622fba0da903f2.tar.gz |
fix spec failuresfeature/cycle-analytics-events
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
8 files changed, 28 insertions, 26 deletions
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 |