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
e827c619
Commit
e827c619
authored
Nov 20, 2019
by
Brett Walker
Committed by
Paul Slaughter
Dec 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional spec for emails_disabled
in project/group settings
parent
6464d437
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
spec/features/groups/group_settings_spec.rb
spec/features/groups/group_settings_spec.rb
+34
-2
spec/features/projects/settings/visibility_settings_spec.rb
spec/features/projects/settings/visibility_settings_spec.rb
+18
-0
No files found.
spec/features/groups/group_settings_spec.rb
View file @
e827c619
...
...
@@ -19,6 +19,7 @@ describe 'Edit group settings' do
it
'the group is accessible via the new path'
do
update_path
(
new_group_path
)
visit
new_group_full_path
expect
(
current_path
).
to
eq
(
new_group_full_path
)
expect
(
find
(
'h1.home-panel-title'
)).
to
have_content
(
group
.
name
)
end
...
...
@@ -26,6 +27,7 @@ describe 'Edit group settings' do
it
'the old group path redirects to the new path'
do
update_path
(
new_group_path
)
visit
old_group_full_path
expect
(
current_path
).
to
eq
(
new_group_full_path
)
expect
(
find
(
'h1.home-panel-title'
)).
to
have_content
(
group
.
name
)
end
...
...
@@ -38,6 +40,7 @@ describe 'Edit group settings' do
it
'the subgroup is accessible via the new path'
do
update_path
(
new_group_path
)
visit
new_subgroup_full_path
expect
(
current_path
).
to
eq
(
new_subgroup_full_path
)
expect
(
find
(
'h1.home-panel-title'
)).
to
have_content
(
subgroup
.
name
)
end
...
...
@@ -45,6 +48,7 @@ describe 'Edit group settings' do
it
'the old subgroup path redirects to the new path'
do
update_path
(
new_group_path
)
visit
old_subgroup_full_path
expect
(
current_path
).
to
eq
(
new_subgroup_full_path
)
expect
(
find
(
'h1.home-panel-title'
)).
to
have_content
(
subgroup
.
name
)
end
...
...
@@ -66,6 +70,7 @@ describe 'Edit group settings' do
it
'the project is accessible via the new path'
do
update_path
(
new_group_path
)
visit
new_project_full_path
expect
(
current_path
).
to
eq
(
new_project_full_path
)
expect
(
find
(
'.breadcrumbs'
)).
to
have_content
(
project
.
path
)
end
...
...
@@ -73,6 +78,7 @@ describe 'Edit group settings' do
it
'the old project path redirects to the new path'
do
update_path
(
new_group_path
)
visit
old_project_full_path
expect
(
current_path
).
to
eq
(
new_project_full_path
)
expect
(
find
(
'.breadcrumbs'
)).
to
have_content
(
project
.
path
)
end
...
...
@@ -101,7 +107,7 @@ describe 'Edit group settings' do
attach_file
(
:group_avatar
,
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'banana_sample.gif'
))
expect
{
save_group
}.
to
change
{
group
.
reload
.
avatar?
}.
to
(
true
)
expect
{
save_g
eneral_g
roup
}.
to
change
{
group
.
reload
.
avatar?
}.
to
(
true
)
end
it
'uploads new group avatar'
do
...
...
@@ -132,6 +138,21 @@ describe 'Edit group settings' do
end
end
context
'disable email notifications'
do
it
'is visible'
do
visit
edit_group_path
(
group
)
expect
(
page
).
to
have_selector
(
'#group_emails_disabled'
,
visible:
true
)
end
it
'accepts the changed state'
do
visit
edit_group_path
(
group
)
check
'group_emails_disabled'
expect
{
save_permissions_group
}.
to
change
{
updated_emails_disabled?
}.
to
(
true
)
end
end
def
update_path
(
new_group_path
)
visit
edit_group_path
(
group
)
...
...
@@ -141,9 +162,20 @@ describe 'Edit group settings' do
end
end
def
save_group
def
save_g
eneral_g
roup
page
.
within
(
'.gs-general'
)
do
click_button
'Save changes'
end
end
def
save_permissions_group
page
.
within
(
'.gs-permissions'
)
do
click_button
'Save changes'
end
end
def
updated_emails_disabled?
group
.
reload
.
clear_memoization
(
:emails_disabled
)
group
.
emails_disabled?
end
end
spec/features/projects/settings/visibility_settings_spec.rb
View file @
e827c619
...
...
@@ -64,6 +64,12 @@ describe 'Projects > Settings > Visibility settings', :js do
it
'is visible'
do
expect
(
page
).
to
have_selector
(
'.js-emails-disabled'
,
visible:
true
)
end
it
'accepts the changed state'
do
find
(
'.js-emails-disabled input[type="checkbox"]'
).
click
expect
{
save_permissions_group
}.
to
change
{
updated_emails_disabled?
}.
to
(
true
)
end
end
end
...
...
@@ -89,4 +95,16 @@ describe 'Projects > Settings > Visibility settings', :js do
end
end
end
def
save_permissions_group
page
.
within
(
'.sharing-permissions'
)
do
click_button
'Save changes'
wait_for_requests
end
end
def
updated_emails_disabled?
project
.
reload
.
clear_memoization
(
:emails_disabled
)
project
.
emails_disabled?
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