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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
b689e2c0
Commit
b689e2c0
authored
Mar 21, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec
parent
45e8650c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
app/models/project.rb
app/models/project.rb
+7
-2
spec/requests/api/group_members_spec.rb
spec/requests/api/group_members_spec.rb
+1
-1
No files found.
app/models/project.rb
View file @
b689e2c0
...
...
@@ -198,7 +198,7 @@ class Project < ActiveRecord::Base
if:
->
(
project
)
{
project
.
avatar
.
present?
&&
project
.
avatar_changed?
}
validates
:avatar
,
file_size:
{
maximum:
200
.
kilobytes
.
to_i
}
validate
:visibility_level_allowed_by_group
validate
:visibility_level_allowed_as_fork
,
on: :update
validate
:visibility_level_allowed_as_fork
add_authentication_token_field
:runners_token
before_save
:ensure_runners_token
...
...
@@ -974,7 +974,12 @@ class Project < ActiveRecord::Base
def
visibility_level_allowed_as_fork?
(
level
=
self
.
visibility_level
)
return
true
unless
forked?
level
<=
forked_from_project
.
visibility_level
# self.forked_from_project will be nil before the project is saved, so
# we need to go through the relation
original_project
=
forked_project_link
.
forked_from_project
return
true
unless
original_project
level
<=
original_project
.
visibility_level
end
def
visibility_level_allowed_by_group?
(
level
=
self
.
visibility_level
)
...
...
spec/requests/api/group_members_spec.rb
View file @
b689e2c0
...
...
@@ -11,7 +11,7 @@ describe API::API, api: true do
let
(
:stranger
)
{
create
(
:user
)
}
let!
(
:group_with_members
)
do
group
=
create
(
:group
)
group
=
create
(
:group
,
:private
)
group
.
add_users
([
reporter
.
id
],
GroupMember
::
REPORTER
)
group
.
add_users
([
developer
.
id
],
GroupMember
::
DEVELOPER
)
group
.
add_users
([
master
.
id
],
GroupMember
::
MASTER
)
...
...
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