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
1beaad2f
Commit
1beaad2f
authored
Apr 07, 2017
by
Simon Knox
Committed by
Jose Ivan Vargas
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix settings test
parent
f1f0722f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
app/assets/javascripts/project_new.js
app/assets/javascripts/project_new.js
+2
-4
spec/features/projects/settings/ee/merge_requests_settings_spec.rb
...ures/projects/settings/ee/merge_requests_settings_spec.rb
+24
-2
No files found.
app/assets/javascripts/project_new.js
View file @
1beaad2f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
(
function
()
{
(
function
()
{
this
.
ProjectNew
=
(
function
()
{
this
.
ProjectNew
=
(
function
()
{
function
ProjectNew
()
{
function
ProjectNew
()
{
this
.
$selects
=
$
(
'
.
project-feature
select
'
);
this
.
$selects
=
$
(
'
.
features
select
'
);
this
.
$repoSelects
=
this
.
$selects
.
filter
(
'
.js-repo-select
'
);
this
.
$repoSelects
=
this
.
$selects
.
filter
(
'
.js-repo-select
'
);
this
.
$enableApprovers
=
$
(
'
.js-require-approvals-toggle
'
);
this
.
$enableApprovers
=
$
(
'
.js-require-approvals-toggle
'
);
...
@@ -17,16 +17,14 @@
...
@@ -17,16 +17,14 @@
this
.
initVisibilitySelect
();
this
.
initVisibilitySelect
();
this
.
toggleSettings
();
this
.
toggleSettings
();
this
.
ad
dEvents
();
this
.
bin
dEvents
();
this
.
toggleRepoVisibility
();
this
.
toggleRepoVisibility
();
}
}
ProjectNew
.
prototype
.
bindEvents
=
function
()
{
ProjectNew
.
prototype
.
bindEvents
=
function
()
{
this
.
toggleSettings
=
this
.
toggleSettings
.
bind
(
this
);
this
.
toggleSettings
=
this
.
toggleSettings
.
bind
(
this
);
this
.
toggleApproverSettingsVisibility
=
this
.
toggleApproverSettingsVisibility
.
bind
(
this
);
this
.
toggleApproverSettingsVisibility
=
this
.
toggleApproverSettingsVisibility
.
bind
(
this
);
};
ProjectNew
.
prototype
.
addEvents
=
function
()
{
this
.
$selects
.
on
(
'
change
'
,
this
.
toggleSettings
);
this
.
$selects
.
on
(
'
change
'
,
this
.
toggleSettings
);
$
(
'
#require_approvals
'
).
on
(
'
change
'
,
this
.
toggleApproverSettingsVisibility
);
$
(
'
#require_approvals
'
).
on
(
'
change
'
,
this
.
toggleApproverSettingsVisibility
);
};
};
...
...
spec/features/projects/settings/ee/merge_requests_settings_spec.rb
View file @
1beaad2f
...
@@ -16,6 +16,20 @@ describe 'Project settings > [EE] Merge Requests', feature: true, js: true do
...
@@ -16,6 +16,20 @@ describe 'Project settings > [EE] Merge Requests', feature: true, js: true do
group
.
add_developer
(
user
)
group
.
add_developer
(
user
)
end
end
scenario
'adds approver'
do
visit
edit_project_path
(
project
)
find
(
'#s2id_approver_user_and_group_ids .select2-input'
).
click
wait_for_ajax
expect
(
find
(
'.select2-results'
)).
to
have_content
(
user
.
name
)
find
(
'.user-result'
,
text:
user
.
name
).
click
click_button
'Add'
expect
(
find
(
'.js-current-approvers'
)).
to
have_content
(
user
.
name
)
end
scenario
'adds approver group'
do
scenario
'adds approver group'
do
visit
edit_project_path
(
project
)
visit
edit_project_path
(
project
)
...
@@ -23,13 +37,21 @@ describe 'Project settings > [EE] Merge Requests', feature: true, js: true do
...
@@ -23,13 +37,21 @@ describe 'Project settings > [EE] Merge Requests', feature: true, js: true do
wait_for_ajax
wait_for_ajax
expect
(
find
(
'.select2-results'
)).
to
have_content
(
group
.
name
)
within
(
'.js-current-approvers'
)
do
expect
(
find
(
'.panel-heading .badge'
)).
to
have_content
(
'0'
)
end
expect
(
find
(
'.select2-results'
)).
to
have_content
(
group
.
name
)
find
(
'.select2-results .group-result'
).
click
find
(
'.select2-results .group-result'
).
click
click_button
'Add'
click_button
'Save changes'
expect
(
find
(
'.approver-list-loader'
)).
to
be_visible
expect
(
page
).
to
have_css
(
'.js-current-approvers li.approver-group'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.js-current-approvers li.approver-group'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.js-current-approvers li.approver-group'
,
count:
1
)
within
(
'.js-current-approvers'
)
do
expect
(
find
(
'.panel-heading .badge'
)).
to
have_content
(
'2'
)
end
end
end
context
'with an approver group'
do
context
'with an approver group'
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