diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-09 12:34:46 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-09 12:34:46 +0400 |
commit | 8a08fdcd32ec58bc538ce5b6fc9df3fbe61d05e1 (patch) | |
tree | c1b1251a164b2518a24fd7295bebbf65116318a5 /spec | |
parent | 80e984ee5e6d29431a4a87ed26105fb0e8987ffb (diff) |
Fix worker specs to parse namespaces
Diffstat (limited to 'spec')
-rw-r--r-- | spec/workers/post_receive_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index bbc91f4474a..443c8c1a3c4 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -14,8 +14,8 @@ describe PostReceive do let(:key_id) { key.identifier } it "fetches the correct project" do - Project.should_receive(:find_by_path).with(project.path).and_return(project) - PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', key_id) + Project.should_receive(:find_by_path).with(project.path_with_namespace).and_return(project) + PostReceive.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id) end it "does not run if the author is not in the project" do @@ -24,7 +24,7 @@ describe PostReceive do project.should_not_receive(:observe_push) project.should_not_receive(:execute_hooks) - PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false + PostReceive.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false end it "asks the project to trigger all hooks" do @@ -34,7 +34,11 @@ describe PostReceive do project.should_receive(:update_merge_requests) project.should_receive(:observe_push) - PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', key_id) + PostReceive.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id) end end + + def pwd(project) + File.join(Gitlab.config.git_base_path, project.path_with_namespace) + end end |