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/models/route_spec.rb')
-rw-r--r--spec/models/route_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/models/route_spec.rb b/spec/models/route_spec.rb
index 7cada013636..8a791a19dec 100644
--- a/spec/models/route_spec.rb
+++ b/spec/models/route_spec.rb
@@ -74,7 +74,7 @@ RSpec.describe Route do
let!(:another_group) { create(:group, path: 'gittlab', name: 'gitllab') }
let!(:another_group_nested) { create(:group, path: 'git_lab', name: 'git_lab', parent: another_group) }
- context 'path update' do
+ shared_examples_for 'path update' do
context 'when route name is set' do
before do
route.update!(path: 'bar')
@@ -116,7 +116,7 @@ RSpec.describe Route do
end
end
- context 'name update' do
+ shared_examples_for 'name update' do
it 'updates children routes with new path' do
route.update!(name: 'bar')
@@ -134,6 +134,18 @@ RSpec.describe Route do
.to change { route.name }.from(nil).to('bar')
end
end
+
+ it_behaves_like 'path update'
+ it_behaves_like 'name update'
+
+ context 'when the feature flag `batch_route_updates` if turned off' do
+ before do
+ stub_feature_flags(batch_route_updates: false)
+ end
+
+ it_behaves_like 'path update'
+ it_behaves_like 'name update'
+ end
end
describe '#create_redirect_for_old_path' do