Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
crabgrass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Goldstein
crabgrass
Commits
5a85389d
Commit
5a85389d
authored
Oct 23, 2018
by
dgt
Committed by
azul
May 4, 2019
Browse files
Options
Downloads
Patches
Plain Diff
WIP: pages still accessible after group was deleted
parent
3f0a987a
Branches
215-access-rights-to-pages-after-group-destruction
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/fixtures/pages.yml
+3
-3
3 additions, 3 deletions
test/fixtures/pages.yml
test/integration/group_destruction_test.rb
+95
-0
95 additions, 0 deletions
test/integration/group_destruction_test.rb
with
98 additions
and
3 deletions
test/fixtures/pages.yml
+
3
−
3
View file @
5a85389d
...
@@ -248,7 +248,7 @@ announcement1:
...
@@ -248,7 +248,7 @@ announcement1:
#
# ASSETS
#
# ASSETS
#
#
#
#
a
sset
1
:
a
sset
_bee
:
owner_name: animals
owner_name: animals
owner_id: 2
owner_id: 2
owner_type: Group
owner_type: Group
...
@@ -272,7 +272,7 @@ asset1:
...
@@ -272,7 +272,7 @@ asset1:
updated_at: "<%= updated.minutes.ago.to_s(:db) %>"
updated_at: "<%= updated.minutes.ago.to_s(:db) %>"
created_at: "<%= created.minutes.ago.to_s(:db) %>"
created_at: "<%= created.minutes.ago.to_s(:db) %>"
a
sset
2
:
a
sset
_sunset
:
owner_name: animals
owner_name: animals
owner_id: 2
owner_id: 2
owner_type: Group
owner_type: Group
...
@@ -296,7 +296,7 @@ asset2:
...
@@ -296,7 +296,7 @@ asset2:
updated_at: "<%= updated.minutes.ago.to_s(:db) %>"
updated_at: "<%= updated.minutes.ago.to_s(:db) %>"
created_at: "<%= created.minutes.ago.to_s(:db) %>"
created_at: "<%= created.minutes.ago.to_s(:db) %>"
a
sset
3
:
a
sset
_crabgrass
:
owner_name: animals
owner_name: animals
owner_id: 2
owner_id: 2
owner_type: Group
owner_type: Group
...
...
This diff is collapsed.
Click to expand it.
test/integration/group_destruction_test.rb
+
95
−
0
View file @
5a85389d
...
@@ -18,4 +18,99 @@ class GroupDestructionTest < IntegrationTest
...
@@ -18,4 +18,99 @@ class GroupDestructionTest < IntegrationTest
click_on
'Groups'
click_on
'Groups'
assert_no_content
'animals'
assert_no_content
'animals'
end
end
def
test_visit_asset_page_owned_by_group_after_group_destruction
@user
=
users
(
:blue
)
login
visit
'/animals'
click_on
'Settings'
click_on
'Structure'
click_on
'Destroy animals'
logout
@user
=
users
(
:penguin
)
login
visit
'/me'
assert_content
'sunset'
click_on
'Show Request'
click_on
'Approve'
visit
'/me'
assert_no_content
'sunset'
visit
pages
(
:asset_sunset
).
uri
assert_not_found
end
def
test_visit_wiki_page_owned_by_group_after_group_destruction
@user
=
users
(
:blue
)
login
visit
'/rainbow'
click_on
'Settings'
click_on
'Structure'
click_on
'Destroy rainbow'
logout
@user
=
users
(
:yellow
)
login
visit
'/me'
assert_content
'page owned by rainbow'
click_on
'Show Request'
click_on
'Approve'
visit
'/me'
assert_no_content
'page owned by rainbow'
visit
pages
(
:rainbow_page
).
uri
assert_not_found
end
def
test_visit_wiki_page_owned_by_group
@user
=
users
(
:blue
)
login
visit
pages
(
:rainbow_page
).
uri
+
'+'
+
pages
(
:rainbow_page
).
id
.
to_s
assert_equal
200
,
status_code
end
def
test_visit_asset_page_owned_by_group_with_user_participation_after_group_destruction
@user
=
users
(
:blue
)
pages
(
:asset_sunset
).
add
(
users
(
:penguin
),
access: :admin
)
pages
(
:asset_sunset
).
save!
assert
pages
(
:asset_sunset
).
owner
==
groups
(
:animals
)
login
visit
'/animals'
click_on
'Settings'
click_on
'Structure'
click_on
'Destroy animals'
logout
@user
=
users
(
:penguin
)
login
visit
'/me'
assert_content
'sunset'
click_on
'Show Request'
click_on
'Approve'
visit
'/me'
#assert_no_content 'sunset' # hidden because of https://0xacab.org/riseuplabs/crabgrass/merge_requests/139/diffs
visit
pages
(
:asset_sunset
).
uri
assert_not_found
end
def
test_visit_wiki_page_owned_by_group_with_user_participation_after_group_destruction
@user
=
users
(
:red
)
pages
(
:rainbow_page
).
add
(
users
(
:yellow
),
access: :admin
)
pages
(
:rainbow_page
).
save!
assert
pages
(
:rainbow_page
).
owner
==
groups
(
:rainbow
)
login
visit
'/rainbow'
click_on
'Settings'
click_on
'Structure'
click_on
'Destroy rainbow'
logout
@user
=
users
(
:yellow
)
login
visit
'/me'
assert_content
'page owned by rainbow'
click_on
'Show Request'
click_on
'Approve'
visit
'/me'
#assert_no_content 'sunset' # hidden because of https://0xacab.org/riseuplabs/crabgrass/merge_requests/139/diffs
#visit pages(:rainbow_page).uri # TEST will pass if we do this
#before (migth be related to caching)
visit
pages
(
:rainbow_page
).
uri
+
'+'
+
pages
(
:rainbow_page
).
id
.
to_s
assert_not_found
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment