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
5f4c1308
Commit
5f4c1308
authored
Mar 15, 2022
by
Gary Holtz
Committed by
Andrew Fontaine
Mar 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving spec to a view spec for cleaner code
parent
0ff446c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
spec/features/projects/forks/fork_list_spec.rb
spec/features/projects/forks/fork_list_spec.rb
+0
-22
spec/views/shared/projects/_list.html.haml_spec.rb
spec/views/shared/projects/_list.html.haml_spec.rb
+12
-0
No files found.
spec/features/projects/forks/fork_list_spec.rb
View file @
5f4c1308
...
...
@@ -24,28 +24,6 @@ RSpec.describe 'listing forks of a project' do
end
end
context
"when a fork is set to allow only project members to access features"
do
let
(
:outside_user
)
{
create
(
:user
)
}
before
do
sign_in
(
outside_user
)
allow_any_instance_of
(
ProjectsHelper
).
to
receive
(
:able_to_see_last_commit?
).
and_return
(
false
)
allow_any_instance_of
(
ProjectsHelper
).
to
receive
(
:able_to_see_merge_requests?
).
and_return
(
false
)
allow_any_instance_of
(
ProjectsHelper
).
to
receive
(
:able_to_see_issues?
).
and_return
(
false
)
end
it
'will not show that information in the original forks list'
do
visit
project_forks_path
(
source
)
page
.
within
(
'li.project-row'
)
do
expect
(
page
).
not_to
have_css
(
'a.commit-row-message'
)
expect
(
page
).
not_to
have_css
(
'a.issues'
)
expect
(
page
).
not_to
have_css
(
'a.merge-requests'
)
end
end
end
it
'does not show the commit message when an external authorization service is used'
do
enable_external_authorization_service_check
...
...
spec/views/shared/projects/_list.html.haml_spec.rb
View file @
5f4c1308
...
...
@@ -20,6 +20,18 @@ RSpec.describe 'shared/projects/_list' do
expect
(
rendered
).
to
have_content
(
project
.
name
)
end
end
it
"will not show elements a user shouldn't be able to see"
do
allow
(
view
).
to
receive
(
:able_to_see_last_commit?
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:able_to_see_merge_requests?
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:able_to_see_issues?
).
and_return
(
false
)
render
expect
(
rendered
).
not_to
have_css
(
'a.commit-row-message'
)
expect
(
rendered
).
not_to
have_css
(
'a.issues'
)
expect
(
rendered
).
not_to
have_css
(
'a.merge-requests'
)
end
end
context
'without projects'
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