diff options
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/cycle_analytics_helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/shared_examples/analytics/cycle_analytics/parentable_examples.rb | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index e4683cbf3c0..3f04d984e55 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -94,8 +94,8 @@ module CycleAnalyticsHelpers wait_for_requests end - def create_value_stream_aggregation(group_or_project_namespace) - aggregation = Analytics::CycleAnalytics::Aggregation.safe_create_for_namespace(group_or_project_namespace) + def create_value_stream_aggregation(namespace) + aggregation = Analytics::CycleAnalytics::Aggregation.safe_create_for_namespace(namespace) Analytics::CycleAnalytics::AggregatorService.new(aggregation: aggregation).execute end diff --git a/spec/support/shared_examples/analytics/cycle_analytics/parentable_examples.rb b/spec/support/shared_examples/analytics/cycle_analytics/parentable_examples.rb index 5fd0e685c67..a6f028a5a04 100644 --- a/spec/support/shared_examples/analytics/cycle_analytics/parentable_examples.rb +++ b/spec/support/shared_examples/analytics/cycle_analytics/parentable_examples.rb @@ -14,15 +14,14 @@ RSpec.shared_examples 'value stream analytics namespace models' do end end - context 'when Namespace is given' do - it 'fails' do - namespace = create(:namespace) + context 'when personal namespace is given' do + it 'is valid' do + namespace = create(:namespace, owner: create(:user)) model = build(factory_name, namespace: namespace) - expect(model).to be_invalid - - error_message = s_('CycleAnalytics|the assigned object is not supported') - expect(model.errors.messages_for(:namespace)).to eq([error_message]) + expect(model).to be_valid + expect(model.save).to be(true) + expect(model.namespace).to eq(namespace) end end end |