Monkeypatch satellite call for merge request in tests
This commit is contained in:
parent
42ce2c1080
commit
28da2a8bdc
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
require 'gitlab/satellite/satellite'
|
||||||
|
|
||||||
class MergeRequestsController < ProjectResourceController
|
class MergeRequestsController < ProjectResourceController
|
||||||
before_filter :module_enabled
|
before_filter :module_enabled
|
||||||
before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status]
|
before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status]
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
require "repository"
|
require "repository"
|
||||||
require "project"
|
require "project"
|
||||||
|
require "merge_request"
|
||||||
require "shell"
|
require "shell"
|
||||||
|
|
||||||
# Stubs out all Git repository access done by models so that specs can run
|
# Stubs out all Git repository access done by models so that specs can run
|
||||||
|
@ -32,6 +33,12 @@ class Project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class MergeRequest
|
||||||
|
def can_be_merged
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class GitLabTestRepo < Repository
|
class GitLabTestRepo < Repository
|
||||||
def repo
|
def repo
|
||||||
@repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'))
|
@repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'))
|
||||||
|
|
Loading…
Reference in a new issue