Fixed mistake and mock warning
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
23c99a98e1
commit
77febe8f1e
|
@ -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 users_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
|
||||||
|
|
|
@ -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
|
||||||
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue