Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
928fbeeec0
commit
49f977d675
|
@ -1,5 +1,5 @@
|
|||
module Issues
|
||||
class CloseService < BaseService
|
||||
class CloseService < Issues::BaseService
|
||||
def execute(issue, commit = nil)
|
||||
if issue.close
|
||||
notification_service.close_issue(issue, current_user)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module Issues
|
||||
class CreateService < BaseService
|
||||
class CreateService < Issues::BaseService
|
||||
def execute
|
||||
issue = project.issues.new(params)
|
||||
issue.author = current_user
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module Issues
|
||||
class ReopenService < BaseService
|
||||
class ReopenService < Issues::BaseService
|
||||
def execute(issue)
|
||||
if issue.reopen
|
||||
event_service.reopen_issue(issue, current_user)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module Issues
|
||||
class UpdateService < BaseService
|
||||
class UpdateService < Issues::BaseService
|
||||
def execute(issue)
|
||||
state = params.delete('state_event')
|
||||
|
||||
|
|
|
@ -170,16 +170,10 @@ describe GitPushService do
|
|||
Issue.find(issue.id).should be_closed
|
||||
end
|
||||
|
||||
it "passes the closing commit as a thread-local" do
|
||||
service.execute(project, user, @oldrev, @newrev, @ref)
|
||||
|
||||
Thread.current[:current_commit].should == closing_commit
|
||||
end
|
||||
|
||||
it "doesn't create cross-reference notes for a closing reference" do
|
||||
expect {
|
||||
service.execute(project, user, @oldrev, @newrev, @ref)
|
||||
}.not_to change { Note.where(project_id: project.id, system: true).count }
|
||||
}.not_to change { Note.where(project_id: project.id, system: true, commit_id: closing_commit.id).count }
|
||||
end
|
||||
|
||||
it "doesn't close issues when pushed to non-default branches" do
|
||||
|
|
Loading…
Reference in New Issue