Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb b/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb
index 3f532629961..9da130d2750 100644
--- a/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb
+++ b/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb
@@ -59,7 +59,9 @@ RSpec.shared_examples 'value stream analytics stage' do
it { expect(stage).not_to be_valid }
end
+ end
+ describe 'scopes' do
# rubocop: disable Rails/SaveBang
describe '.by_value_stream' do
it 'finds stages by value stream' do
@@ -71,6 +73,17 @@ RSpec.shared_examples 'value stream analytics stage' do
expect(result).to eq([stage1])
end
end
+
+ describe '.by_value_stream_ids' do
+ it 'finds stages by array of value streams ids' do
+ stages = create_list(factory, 2)
+ create(factory) # To be left out of the results
+
+ result = described_class.by_value_streams_ids(stages.map(&:value_stream_id))
+
+ expect(result).to match_array(stages)
+ end
+ end
# rubocop: enable Rails/SaveBang
end