diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-29 01:55:41 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-29 01:55:41 -0400 |
commit | 1dda08486b7751a677870486d4b576e6dd6071e7 (patch) | |
tree | 5eda64c46cd5caf655f517877767267b88adcb1c /spec/support | |
parent | 39ff033d1ab536c4e493510ee99e392b5fd25a07 (diff) | |
download | gitlab-ce-1dda08486b7751a677870486d4b576e6dd6071e7.tar.gz |
Only include StubbedRepository in Project model
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/stubbed_repository.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/spec/support/stubbed_repository.rb b/spec/support/stubbed_repository.rb index 8dd4f40e084..90491e430b4 100644 --- a/spec/support/stubbed_repository.rb +++ b/spec/support/stubbed_repository.rb @@ -1,19 +1,7 @@ # Stubs out all Git repository access done by models so that specs can run # against fake repositories without Grit complaining that they don't exist. module StubbedRepository - extend ActiveSupport::Concern - - included do - # If a class defines the method we want to stub directly, rather than - # inheriting it from a module (as is the case in UsersProject), that method - # will overwrite our stub, so use alias_method to ensure it's our stub - # getting called. - - alias_method :path_to_repo, :fake_path_to_repo - alias_method :satellite, :fake_satellite - end - - def fake_path_to_repo + def path_to_repo if new_record? || path == 'newproject' # There are a couple Project specs and features that expect the Project's # path to be in the returned path, so let's patronize them. @@ -25,7 +13,7 @@ module StubbedRepository end end - def fake_satellite + def satellite FakeSatellite.new end @@ -40,6 +28,4 @@ module StubbedRepository end end -[Project, ProtectedBranch, UsersProject].each do |c| - c.send(:include, StubbedRepository) -end +Project.send(:include, StubbedRepository) |