BigW Consortium Gitlab

monkeypatch.rb 615 Bytes
Newer Older
1
# Stubbing Project <-> git host path
gitlabhq committed
2
# create project using Factory only
Nihad Abbasov committed
3
class Project
4
  def update_repository
gitlabhq committed
5 6 7
    true
  end

randx committed
8
  def destroy_repository
gitlabhq committed
9 10 11
    true
  end

Nihad Abbasov committed
12
  def path_to_repo
gitlabhq committed
13
    File.join(Rails.root, "tmp", "tests", path)
gitlabhq committed
14
  end
gitlabhq committed
15 16 17 18

  def satellite
    @satellite ||= FakeSatellite.new
  end
gitlabhq committed
19 20
end

Nihad Abbasov committed
21
class Key
22
  def update_repository
gitlabhq committed
23 24 25
    true
  end

26
  def repository_delete_key
gitlabhq committed
27 28 29 30 31
    true
  end
end

class UsersProject
32
  def update_repository
gitlabhq committed
33 34 35
    true
  end
end
gitlabhq committed
36 37

class FakeSatellite
38
  def exists?
gitlabhq committed
39 40 41 42 43 44 45 46
    true
  end

  def create
    true
  end
end

47 48 49 50 51
class ProtectedBranch
  def update_repository
    true
  end
end