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
3488e8f0
Commit
3488e8f0
authored
Aug 26, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for dynamically changing namespace selector within new project form
parent
f82ec4a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
spec/features/projects/new_project_spec.rb
spec/features/projects/new_project_spec.rb
+37
-16
No files found.
spec/features/projects/new_project_spec.rb
View file @
3488e8f0
require
'spec_helper'
require
'spec_helper'
feature
'New project'
do
feature
'New project'
do
include
Select2Helper
let
(
:user
)
{
create
(
:admin
)
}
let
(
:user
)
{
create
(
:admin
)
}
before
do
before
do
...
@@ -68,22 +70,6 @@ feature 'New project' do
...
@@ -68,22 +70,6 @@ feature 'New project' do
expect
(
namespace
.
text
).
to
eq
group
.
name
expect
(
namespace
.
text
).
to
eq
group
.
name
end
end
context
'on validation error'
do
before
do
fill_in
(
'project_path'
,
with:
'private-group-project'
)
choose
(
'Internal'
)
click_button
(
'Create project'
)
expect
(
page
).
to
have_css
'.project-edit-errors .alert.alert-danger'
end
it
'selects the group namespace'
do
namespace
=
find
(
'#project_namespace_id option[selected]'
)
expect
(
namespace
.
text
).
to
eq
group
.
name
end
end
end
end
context
'with subgroup namespace'
do
context
'with subgroup namespace'
do
...
@@ -101,6 +87,41 @@ feature 'New project' do
...
@@ -101,6 +87,41 @@ feature 'New project' do
expect
(
namespace
.
text
).
to
eq
subgroup
.
full_path
expect
(
namespace
.
text
).
to
eq
subgroup
.
full_path
end
end
end
end
context
'when changing namespaces dynamically'
,
:js
do
let
(
:public_group
)
{
create
(
:group
,
:public
)
}
let
(
:internal_group
)
{
create
(
:group
,
:internal
)
}
let
(
:private_group
)
{
create
(
:group
,
:private
)
}
before
do
public_group
.
add_owner
(
user
)
internal_group
.
add_owner
(
user
)
private_group
.
add_owner
(
user
)
visit
new_project_path
(
namespace_id:
public_group
.
id
)
end
it
'enables the correct visibility options'
do
select2
(
user
.
namespace_id
,
from:
'#project_namespace_id'
)
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PRIVATE
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
INTERNAL
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PUBLIC
}
"
)).
not_to
be_disabled
select2
(
public_group
.
id
,
from:
'#project_namespace_id'
)
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PRIVATE
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
INTERNAL
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PUBLIC
}
"
)).
not_to
be_disabled
select2
(
internal_group
.
id
,
from:
'#project_namespace_id'
)
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PRIVATE
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
INTERNAL
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PUBLIC
}
"
)).
to
be_disabled
select2
(
private_group
.
id
,
from:
'#project_namespace_id'
)
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PRIVATE
}
"
)).
not_to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
INTERNAL
}
"
)).
to
be_disabled
expect
(
find
(
"#project_visibility_level_
#{
Gitlab
::
VisibilityLevel
::
PUBLIC
}
"
)).
to
be_disabled
end
end
end
end
context
'Import project options'
do
context
'Import project options'
do
...
...
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