Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b6c4dce0
Commit
b6c4dce0
authored
Dec 20, 2019
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uniquifies path slug creation for trial group name
parent
7a8057fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+1
-1
ee/changelogs/unreleased/42774-new-trial-creation-fails-if-group-url-is-already-taken.yml
...ew-trial-creation-fails-if-group-url-is-already-taken.yml
+5
-0
ee/spec/features/trials/select_namespace_spec.rb
ee/spec/features/trials/select_namespace_spec.rb
+9
-4
No files found.
ee/app/controllers/trials_controller.rb
View file @
b6c4dce0
...
...
@@ -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?
...
...
ee/changelogs/unreleased/42774-new-trial-creation-fails-if-group-url-is-already-taken.yml
0 → 100644
View file @
b6c4dce0
---
title
:
Uniquifies path slug creation from trial new group name
merge_request
:
22147
author
:
type
:
added
ee/spec/features/trials/select_namespace_spec.rb
View file @
b6c4dce0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment