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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
6ec561a2
Commit
6ec561a2
authored
Jul 28, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed up specs
parent
f8e5941d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
55 deletions
+71
-55
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+44
-44
features/steps/project/project.rb
features/steps/project/project.rb
+12
-4
features/steps/shared/project.rb
features/steps/shared/project.rb
+1
-1
spec/features/projects/features_visibility_spec.rb
spec/features/projects/features_visibility_spec.rb
+14
-6
No files found.
app/views/projects/edit.html.haml
View file @
6ec561a2
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
=
expanded
?
'Collapse'
:
'Expand'
=
expanded
?
'Collapse'
:
'Expand'
%p
%p
Enable or disable certain project features and choose access levels.
Enable or disable certain project features and choose access levels.
.settings-content.no-animate
{
class:
(
'expan
e
ded'
if
expanded
)
}
.settings-content.no-animate
{
class:
(
'expanded'
if
expanded
)
}
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"sharing-permissions-form"
},
authenticity_token:
true
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"sharing-permissions-form"
},
authenticity_token:
true
do
|
f
|
.form_group.sharing-and-permissions
.form_group.sharing-and-permissions
.row.js-visibility-select
.row.js-visibility-select
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
=
f
.
submit
'Save changes'
,
class:
"btn btn-save"
=
f
.
submit
'Save changes'
,
class:
"btn btn-save"
%section
.settings.merge-request
-settings
{
style:
(
"display: none;"
if
@project
.
project_feature
.
send
(
:merge_requests_access_level
)
==
0
)
}
%section
.settings.merge-request
s-feature
{
style:
(
"display: none;"
if
@project
.
project_feature
.
send
(
:merge_requests_access_level
)
==
0
)
}
.settings-header
.settings-header
%h4
%h4
Merge request settings
Merge request settings
...
...
features/steps/project/project.rb
View file @
6ec561a2
...
@@ -10,8 +10,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -10,8 +10,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I save project'
do
step
'I save project'
do
page
.
within
'.general-settings'
do
click_button
'Save changes'
click_button
'Save changes'
end
end
end
step
'I should see project with new settings'
do
step
'I should see project with new settings'
do
expect
(
find_field
(
'project_name'
).
value
).
to
eq
'NewName'
expect
(
find_field
(
'project_name'
).
value
).
to
eq
'NewName'
...
@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar
,
:project_avatar
,
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
)
)
page
.
within
'.general-settings'
do
click_button
'Save changes'
click_button
'Save changes'
end
@project
.
reload
@project
.
reload
end
end
...
@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar
,
:project_avatar
,
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
)
)
page
.
within
'.general-settings'
do
click_button
'Save changes'
click_button
'Save changes'
end
@project
.
reload
@project
.
reload
end
end
...
@@ -69,8 +75,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -69,8 +75,10 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step
'change project default branch'
do
step
'change project default branch'
do
select
'fix'
,
from:
'project_default_branch'
select
'fix'
,
from:
'project_default_branch'
page
.
within
'.general-settings'
do
click_button
'Save changes'
click_button
'Save changes'
end
end
end
step
'I should see project default branch changed'
do
step
'I should see project default branch changed'
do
expect
(
find
(
:css
,
'select#project_default_branch'
).
value
).
to
eq
'fix'
expect
(
find
(
:css
,
'select#project_default_branch'
).
value
).
to
eq
'fix'
...
...
features/steps/shared/project.rb
View file @
6ec561a2
...
@@ -103,7 +103,7 @@ module SharedProject
...
@@ -103,7 +103,7 @@ module SharedProject
step
'I should see project settings'
do
step
'I should see project settings'
do
expect
(
current_path
).
to
eq
edit_project_path
(
@project
)
expect
(
current_path
).
to
eq
edit_project_path
(
@project
)
expect
(
page
).
to
have_content
(
"Project name"
)
expect
(
page
).
to
have_content
(
"Project name"
)
expect
(
page
).
to
have_content
(
"Sharing
& P
ermissions"
)
expect
(
page
).
to
have_content
(
"Sharing
and p
ermissions"
)
end
end
def
current_project
def
current_project
...
...
spec/features/projects/features_visibility_spec.rb
View file @
6ec561a2
...
@@ -39,8 +39,6 @@ describe 'Edit Project Settings' do
...
@@ -39,8 +39,6 @@ describe 'Edit Project Settings' do
end
end
wait_for_requests
wait_for_requests
expect
(
page
).
to
have_selector
(
".shortcuts-
#{
shortcut_name
}
"
)
expect
(
page
).
to
have_selector
(
".shortcuts-
#{
shortcut_name
}
"
)
sleep
0.1
end
end
end
end
end
end
...
@@ -180,7 +178,11 @@ describe 'Edit Project Settings' do
...
@@ -180,7 +178,11 @@ describe 'Edit Project Settings' do
it
"disables repository related features"
do
it
"disables repository related features"
do
select
"Disabled"
,
from:
"project_project_feature_attributes_repository_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_repository_access_level"
expect
(
find
(
".edit-project"
)).
to
have_selector
(
"select.disabled"
,
count:
2
)
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
end
expect
(
find
(
".sharing-permissions"
)).
to
have_selector
(
"select.disabled"
,
count:
2
)
end
end
it
"shows empty features project homepage"
do
it
"shows empty features project homepage"
do
...
@@ -188,7 +190,9 @@ describe 'Edit Project Settings' do
...
@@ -188,7 +190,9 @@ describe 'Edit Project Settings' do
select
"Disabled"
,
from:
"project_project_feature_attributes_issues_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_issues_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_wiki_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_wiki_access_level"
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
click_button
"Save changes"
end
wait_for_requests
wait_for_requests
visit
project_path
(
project
)
visit
project_path
(
project
)
...
@@ -201,7 +205,9 @@ describe 'Edit Project Settings' do
...
@@ -201,7 +205,9 @@ describe 'Edit Project Settings' do
select
"Disabled"
,
from:
"project_project_feature_attributes_issues_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_issues_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_wiki_access_level"
select
"Disabled"
,
from:
"project_project_feature_attributes_wiki_access_level"
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
click_button
"Save changes"
end
wait_for_requests
wait_for_requests
visit
activity_project_path
(
project
)
visit
activity_project_path
(
project
)
...
@@ -242,7 +248,9 @@ describe 'Edit Project Settings' do
...
@@ -242,7 +248,9 @@ describe 'Edit Project Settings' do
end
end
def
save_changes_and_check_activity_tab
def
save_changes_and_check_activity_tab
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
click_button
"Save changes"
end
wait_for_requests
wait_for_requests
visit
activity_project_path
(
project
)
visit
activity_project_path
(
project
)
...
...
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