diff options
author | Małgorzata Ksionek <mksionek@gitlab.com> | 2019-07-18 17:07:36 +0300 |
---|---|---|
committer | Małgorzata Ksionek <mksionek@gitlab.com> | 2019-07-23 13:01:39 +0300 |
commit | 5ce4236b66465c4edd8edb87e8f9661fdb4ca8c2 (patch) | |
tree | ef384cf2e9c1e33aef22be286cddac435379a0ef /spec/lib/gitlab/cycle_analytics | |
parent | f70d931b88829585da7915b11bd4775297b6dac9 (diff) |
Add code review remarks
Add cr remarks
Improve specs according to the review
Fix schema
Add cr remarks
Fix naming
Add cr remarks
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
-rw-r--r-- | spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb | 7 | ||||
-rw-r--r-- | spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb | 8 |
2 files changed, 7 insertions, 8 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb b/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb index d4dd52ec092..d5c2f7cc579 100644 --- a/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb @@ -8,7 +8,7 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do let(:from) { 1.day.ago } let(:user) { create(:user, :admin) } - subject { described_class.new(group, from: Time.now, current_user: user, options: {}).data } + subject { described_class.new(group, options: { from: Time.now, current_user: user }).data } describe "#new_issues" do context 'with from date' do @@ -38,7 +38,7 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do Timecop.freeze(5.days.from_now) { create(:issue, project: create(:project, namespace: group)) } end - subject { described_class.new(group, from: Time.now, current_user: user, options: { projects: [project.id, project_2.id] }).data } + subject { described_class.new(group, options: { from: Time.now, current_user: user, projects: [project.id, project_2.id] }).data } it 'finds issues from those projects' do expect(subject.first[:value]).to eq(2) @@ -91,7 +91,7 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do end end - subject { described_class.new(group, from: Time.now, current_user: user, options: { projects: [project.id, project_2.id] }).data } + subject { described_class.new(group, options: { from: Time.now, current_user: user, projects: [project.id, project_2.id] }).data } it 'shows deploys from those projects' do expect(subject.second[:value]).to eq(2) @@ -110,6 +110,5 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do expect(subject.second[:value]).to eq(0) end end - end end diff --git a/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb index 1052ee69830..dea17e4f3dc 100644 --- a/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb @@ -85,11 +85,11 @@ describe Gitlab::CycleAnalytics::IssueStage do end describe '#events' do - it 'exposes merge requests that close issues' do - result = stage.events + subject { stage.events } - expect(result.count).to eq(1) - expect(result.map { |event| event[:title] }).to contain_exactly(issue_2_1.title) + it 'exposes merge requests that close issues' do + expect(subject.count).to eq(1) + expect(subject.map { |event| event[:title] }).to contain_exactly(issue_2_1.title) end end end |