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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
77febe8f
Commit
77febe8f
authored
Dec 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed mistake and mock warning
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
23c99a98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/user.rb
app/models/user.rb
+1
-1
spec/support/mentionable_shared_examples.rb
spec/support/mentionable_shared_examples.rb
+2
-2
No files found.
app/models/user.rb
View file @
77febe8f
...
@@ -80,7 +80,7 @@ class User < ActiveRecord::Base
...
@@ -80,7 +80,7 @@ class User < ActiveRecord::Base
# Groups
# Groups
has_many
:users_groups
,
dependent: :destroy
has_many
:users_groups
,
dependent: :destroy
has_many
:groups
,
through: :users_groups
has_many
:groups
,
through: :users_groups
has_many
:owned_groups
,
->
{
where
user
_group
:
{
group_access:
UsersGroup
::
OWNER
}
},
through: :users_groups
,
source: :group
has_many
:owned_groups
,
->
{
where
user
s_groups
:
{
group_access:
UsersGroup
::
OWNER
}
},
through: :users_groups
,
source: :group
# Projects
# Projects
has_many
:groups_projects
,
through: :groups
,
source: :projects
has_many
:groups_projects
,
through: :groups
,
source: :projects
has_many
:personal_projects
,
through: :namespace
,
source: :projects
has_many
:personal_projects
,
through: :namespace
,
source: :projects
...
...
spec/support/mentionable_shared_examples.rb
View file @
77febe8f
...
@@ -12,7 +12,7 @@ def common_mentionable_setup
...
@@ -12,7 +12,7 @@ def common_mentionable_setup
let
(
:mentioned_issue
)
{
create
:issue
,
project:
mproject
}
let
(
:mentioned_issue
)
{
create
:issue
,
project:
mproject
}
let
(
:other_issue
)
{
create
:issue
,
project:
mproject
}
let
(
:other_issue
)
{
create
:issue
,
project:
mproject
}
let
(
:mentioned_mr
)
{
create
:merge_request
,
target_project:
mproject
,
source_branch:
'different'
}
let
(
:mentioned_mr
)
{
create
:merge_request
,
target_project:
mproject
,
source_branch:
'different'
}
let
(
:mentioned_commit
)
{
mock
(
'commit'
,
sha:
'1234567890abcdef'
).
as_null_object
}
let
(
:mentioned_commit
)
{
double
(
'commit'
,
sha:
'1234567890abcdef'
).
as_null_object
}
# Override to add known commits to the repository stub.
# Override to add known commits to the repository stub.
let
(
:extra_commits
)
{
[]
}
let
(
:extra_commits
)
{
[]
}
...
@@ -30,7 +30,7 @@ def common_mentionable_setup
...
@@ -30,7 +30,7 @@ def common_mentionable_setup
commitmap
=
{
'123456'
=>
mentioned_commit
}
commitmap
=
{
'123456'
=>
mentioned_commit
}
extra_commits
.
each
{
|
c
|
commitmap
[
c
.
sha
[
0
..
5
]]
=
c
}
extra_commits
.
each
{
|
c
|
commitmap
[
c
.
sha
[
0
..
5
]]
=
c
}
repo
=
mock
(
'repository'
)
repo
=
double
(
'repository'
)
repo
.
stub
(
:commit
)
{
|
sha
|
commitmap
[
sha
]
}
repo
.
stub
(
:commit
)
{
|
sha
|
commitmap
[
sha
]
}
mproject
.
stub
(
repository:
repo
)
mproject
.
stub
(
repository:
repo
)
...
...
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