From ed39d61d746925e49d952bd8169499d3200ae68b Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 17 Nov 2016 13:22:27 +0100 Subject: refactor events facade so it uses separate classes and refactor query stuff --- spec/lib/gitlab/cycle_analytics/code_config_spec.rb | 10 ---------- spec/lib/gitlab/cycle_analytics/code_event_spec.rb | 10 ++++++++++ spec/lib/gitlab/cycle_analytics/issue_config_spec.rb | 10 ---------- spec/lib/gitlab/cycle_analytics/issue_event_spec.rb | 10 ++++++++++ spec/lib/gitlab/cycle_analytics/plan_config_spec.rb | 10 ---------- spec/lib/gitlab/cycle_analytics/plan_event_spec.rb | 10 ++++++++++ .../gitlab/cycle_analytics/production_config_spec.rb | 10 ---------- .../gitlab/cycle_analytics/production_event_spec.rb | 10 ++++++++++ spec/lib/gitlab/cycle_analytics/review_config_spec.rb | 10 ---------- spec/lib/gitlab/cycle_analytics/review_event_spec.rb | 10 ++++++++++ spec/lib/gitlab/cycle_analytics/shared_config_spec.rb | 15 --------------- spec/lib/gitlab/cycle_analytics/shared_event_spec.rb | 19 +++++++++++++++++++ .../lib/gitlab/cycle_analytics/staging_config_spec.rb | 10 ---------- spec/lib/gitlab/cycle_analytics/staging_event_spec.rb | 10 ++++++++++ spec/lib/gitlab/cycle_analytics/test_config_spec.rb | 10 ---------- spec/lib/gitlab/cycle_analytics/test_event_spec.rb | 10 ++++++++++ 16 files changed, 89 insertions(+), 85 deletions(-) delete mode 100644 spec/lib/gitlab/cycle_analytics/code_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/code_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/issue_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/issue_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/plan_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/plan_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/production_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/production_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/review_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/review_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/shared_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/shared_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/staging_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/staging_event_spec.rb delete mode 100644 spec/lib/gitlab/cycle_analytics/test_config_spec.rb create mode 100644 spec/lib/gitlab/cycle_analytics/test_event_spec.rb (limited to 'spec/lib') diff --git a/spec/lib/gitlab/cycle_analytics/code_config_spec.rb b/spec/lib/gitlab/cycle_analytics/code_config_spec.rb deleted file mode 100644 index 7b89fdd76aa..00000000000 --- a/spec/lib/gitlab/cycle_analytics/code_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::CodeConfig 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) - end -end diff --git a/spec/lib/gitlab/cycle_analytics/code_event_spec.rb b/spec/lib/gitlab/cycle_analytics/code_event_spec.rb new file mode 100644 index 00000000000..7b854d7fea1 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/code_event_spec.rb @@ -0,0 +1,10 @@ +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) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/issue_config_spec.rb b/spec/lib/gitlab/cycle_analytics/issue_config_spec.rb deleted file mode 100644 index ff8cd1e8068..00000000000 --- a/spec/lib/gitlab/cycle_analytics/issue_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::IssueConfig do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) - end -end diff --git a/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb b/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb new file mode 100644 index 00000000000..2d7e7b1e0a5 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/issue_event_spec.rb @@ -0,0 +1,10 @@ +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) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/plan_config_spec.rb b/spec/lib/gitlab/cycle_analytics/plan_config_spec.rb deleted file mode 100644 index 92698defa5d..00000000000 --- a/spec/lib/gitlab/cycle_analytics/plan_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::PlanConfig do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) - end -end diff --git a/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb b/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb new file mode 100644 index 00000000000..3452c146584 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/plan_event_spec.rb @@ -0,0 +1,10 @@ +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) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/production_config_spec.rb b/spec/lib/gitlab/cycle_analytics/production_config_spec.rb deleted file mode 100644 index 92485777334..00000000000 --- a/spec/lib/gitlab/cycle_analytics/production_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::ProductionConfig do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).to eq(described_class.start_time_attrs) - end -end diff --git a/spec/lib/gitlab/cycle_analytics/production_event_spec.rb b/spec/lib/gitlab/cycle_analytics/production_event_spec.rb new file mode 100644 index 00000000000..069c84efa09 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/production_event_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' +require 'lib/gitlab/cycle_analytics/shared_event_spec' + +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) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/review_config_spec.rb b/spec/lib/gitlab/cycle_analytics/review_config_spec.rb deleted file mode 100644 index 59cb18ac16d..00000000000 --- a/spec/lib/gitlab/cycle_analytics/review_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::ReviewConfig do - it_behaves_like 'default query config' - - it 'has the default order' do - expect(described_class.order).to eq(described_class.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 new file mode 100644 index 00000000000..e9aca82ecc9 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/review_event_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' +require 'lib/gitlab/cycle_analytics/shared_event_spec' + +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) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/shared_config_spec.rb b/spec/lib/gitlab/cycle_analytics/shared_config_spec.rb deleted file mode 100644 index 060a59151d8..00000000000 --- a/spec/lib/gitlab/cycle_analytics/shared_config_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -shared_examples 'default query config' do - it 'has the start attributes' do - expect(described_class.start_time_attrs).not_to be_nil - end - - it 'has the end attributes' do - expect(described_class.end_time_attrs ).not_to be_nil - end - - it 'has the projection attributes' do - expect(described_class.projections).not_to be_nil - end -end diff --git a/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb b/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb new file mode 100644 index 00000000000..b15af783dfb --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +shared_examples 'default query config' do + it 'has the start attributes' do + expect(described_class.start_time_attrs).not_to be_nil + end + + it 'has the end attributes' do + expect(described_class.end_time_attrs ).not_to be_nil + end + + it 'has the projection attributes' do + expect(described_class.projections).not_to be_nil + end + + it 'implements the fetch method' do + expect(described_class.fetch).not_to raise_error + end +end diff --git a/spec/lib/gitlab/cycle_analytics/staging_config_spec.rb b/spec/lib/gitlab/cycle_analytics/staging_config_spec.rb deleted file mode 100644 index f13885d7f48..00000000000 --- a/spec/lib/gitlab/cycle_analytics/staging_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::StagingConfig 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) - end -end diff --git a/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb b/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb new file mode 100644 index 00000000000..9c1bec3edb1 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/staging_event_spec.rb @@ -0,0 +1,10 @@ +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) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/test_config_spec.rb b/spec/lib/gitlab/cycle_analytics/test_config_spec.rb deleted file mode 100644 index 59421b99513..00000000000 --- a/spec/lib/gitlab/cycle_analytics/test_config_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'spec_helper' -require 'lib/gitlab/cycle_analytics/shared_config_spec' - -describe Gitlab::CycleAnalytics::TestConfig 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) - end -end diff --git a/spec/lib/gitlab/cycle_analytics/test_event_spec.rb b/spec/lib/gitlab/cycle_analytics/test_event_spec.rb new file mode 100644 index 00000000000..7238b9a34b3 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/test_event_spec.rb @@ -0,0 +1,10 @@ +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) + end +end -- cgit v1.2.3