diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-01-18 18:22:35 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-01-18 18:22:35 +0000 |
commit | 1cc6d206b5d4cf09bb502a254703f3a2de2dbeb7 (patch) | |
tree | d9c1d5c3c56f2416bbc037cca6a7b92b7a7a4f41 /spec/support | |
parent | cc1e43da3993b6839b4dbe03ae1b8bfb81066666 (diff) | |
parent | 1d775d9712d0c493ae171e37fe507f5160cd7d0e (diff) | |
download | gitlab-ce-1cc6d206b5d4cf09bb502a254703f3a2de2dbeb7.tar.gz |
Merge branch 'fix/refactor-cycle-analytics-stages' into 'master'
Refactor cycle analytics stages (1st iteration)
See merge request !7647
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/cycle_analytics_helpers/test_generation.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/support/cycle_analytics_helpers/test_generation.rb b/spec/support/cycle_analytics_helpers/test_generation.rb index 8e19a6c92e2..35b40d73191 100644 --- a/spec/support/cycle_analytics_helpers/test_generation.rb +++ b/spec/support/cycle_analytics_helpers/test_generation.rb @@ -2,7 +2,6 @@ # Note: The ABC size is large here because we have a method generating test cases with # multiple nested contexts. This shouldn't count as a violation. - module CycleAnalyticsHelpers module TestGeneration # Generate the most common set of specs that all cycle analytics phases need to have. @@ -51,7 +50,7 @@ module CycleAnalyticsHelpers end median_time_difference = time_differences.sort[2] - expect(subject.send(phase)).to be_within(5).of(median_time_difference) + expect(subject[phase].median).to be_within(5).of(median_time_difference) end context "when the data belongs to another project" do @@ -83,7 +82,7 @@ module CycleAnalyticsHelpers # Turn off the stub before checking assertions allow(self).to receive(:project).and_call_original - expect(subject.send(phase)).to be_nil + expect(subject[phase].median).to be_nil end end @@ -106,7 +105,7 @@ module CycleAnalyticsHelpers Timecop.freeze(end_time + 1.day) { post_fn[self, data] } if post_fn - expect(subject.send(phase)).to be_nil + expect(subject[phase].median).to be_nil end end end @@ -126,7 +125,7 @@ module CycleAnalyticsHelpers Timecop.freeze(end_time + 1.day) { post_fn[self, data] } if post_fn end - expect(subject.send(phase)).to be_nil + expect(subject[phase].median).to be_nil end end end @@ -145,7 +144,7 @@ module CycleAnalyticsHelpers post_fn[self, data] if post_fn end - expect(subject.send(phase)).to be_nil + expect(subject[phase].median).to be_nil end end end @@ -153,7 +152,7 @@ module CycleAnalyticsHelpers context "when none of the start / end conditions are matched" do it "returns nil" do - expect(subject.send(phase)).to be_nil + expect(subject[phase].median).to be_nil end end end |