Commit 77febe8f1e867874c10fff9f70011f7e67c1a5f8

Authored by Dmitriy Zaporozhets
1 parent 23c99a98

Fixed mistake and mock warning

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/models/user.rb
... ... @@ -80,7 +80,7 @@ class User &lt; ActiveRecord::Base
80 80 # Groups
81 81 has_many :users_groups, dependent: :destroy
82 82 has_many :groups, through: :users_groups
83   - has_many :owned_groups, -> { where user_group: { group_access: UsersGroup::OWNER } }, through: :users_groups, source: :group
  83 + has_many :owned_groups, -> { where users_groups: { group_access: UsersGroup::OWNER } }, through: :users_groups, source: :group
84 84 # Projects
85 85 has_many :groups_projects, through: :groups, source: :projects
86 86 has_many :personal_projects, through: :namespace, source: :projects
... ...
spec/support/mentionable_shared_examples.rb
... ... @@ -12,7 +12,7 @@ def common_mentionable_setup
12 12 let(:mentioned_issue) { create :issue, project: mproject }
13 13 let(:other_issue) { create :issue, project: mproject }
14 14 let(:mentioned_mr) { create :merge_request, target_project: mproject, source_branch: 'different' }
15   - let(:mentioned_commit) { mock('commit', sha: '1234567890abcdef').as_null_object }
  15 + let(:mentioned_commit) { double('commit', sha: '1234567890abcdef').as_null_object }
16 16  
17 17 # Override to add known commits to the repository stub.
18 18 let(:extra_commits) { [] }
... ... @@ -30,7 +30,7 @@ def common_mentionable_setup
30 30 commitmap = { '123456' => mentioned_commit }
31 31 extra_commits.each { |c| commitmap[c.sha[0..5]] = c }
32 32  
33   - repo = mock('repository')
  33 + repo = double('repository')
34 34 repo.stub(:commit) { |sha| commitmap[sha] }
35 35 mproject.stub(repository: repo)
36 36  
... ...