Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
fc65f717
Commit
fc65f717
authored
Sep 02, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix post-receive specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
730712f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
spec/workers/post_receive_spec.rb
spec/workers/post_receive_spec.rb
+7
-4
No files found.
spec/workers/post_receive_spec.rb
View file @
fc65f717
require
'spec_helper'
describe
PostReceive
do
context
"as a resque worker"
do
it
"reponds to #perform"
do
PostReceive
.
new
.
should
respond_to
(
:perform
)
...
...
@@ -15,7 +14,7 @@ describe PostReceive do
it
"fetches the correct project"
do
Project
.
should_receive
(
:find_with_namespace
).
with
(
project
.
path_with_namespace
).
and_return
(
project
)
PostReceive
.
new
.
perform
(
pwd
(
project
),
'sha-old'
,
'sha-new'
,
'refs/heads/master'
,
key_id
)
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
changes
)
end
it
"does not run if the author is not in the project"
do
...
...
@@ -23,7 +22,7 @@ describe PostReceive do
project
.
should_not_receive
(
:execute_hooks
)
PostReceive
.
new
.
perform
(
pwd
(
project
),
'sha-old'
,
'sha-new'
,
'refs/heads/master'
,
key_id
).
should
be_false
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
changes
).
should
be_false
end
it
"asks the project to trigger all hooks"
do
...
...
@@ -32,11 +31,15 @@ describe PostReceive do
project
.
should_receive
(
:execute_services
)
project
.
should_receive
(
:update_merge_requests
)
PostReceive
.
new
.
perform
(
pwd
(
project
),
'sha-old'
,
'sha-new'
,
'refs/heads/master'
,
key_id
)
PostReceive
.
new
.
perform
(
pwd
(
project
),
key_id
,
changes
)
end
end
def
pwd
(
project
)
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
project
.
path_with_namespace
)
end
def
changes
'd14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment