Commit b6c4dce0 authored by Alper Akgun's avatar Alper Akgun

Uniquifies path slug creation for trial group name

parent 7a8057fd
......@@ -91,7 +91,7 @@ class TrialsController < ApplicationController
def create_group
name = sanitize(params[:new_group_name])
group = Groups::CreateService.new(current_user, name: name, path: name.parameterize).execute
group = Groups::CreateService.new(current_user, name: name, path: Namespace.clean_path(name.parameterize)).execute
params[:namespace_id] = group.id if group.persisted?
......
---
title: Uniquifies path slug creation from trial new group name
merge_request: 22147
author:
type: added
......@@ -64,16 +64,21 @@ describe 'Trial Select Namespace', :js do
context 'enters an existing group name' do
let!(:namespace) { create(:namespace, owner_id: user.id, path: 'gitlab') }
it 'shows validation error' do
before do
expect_any_instance_of(GitlabSubscriptions::ApplyTrialService).to receive(:execute) do
{ success: true }
end
end
it 'proceeds to the next step with a unique url' do
fill_in 'New Group Name', with: namespace.path
click_button 'Start your free trial'
wait_for_requests
expect(page).to have_selector('.flash-text')
expect(find('.flash-alert')).to have_text('Group URL has already been taken')
expect(current_path).to eq(apply_trials_path)
expect(page).not_to have_css('flash-container')
expect(current_path).to eq('/gitlab1')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment