Skip to content
Snippets Groups Projects
Verified Commit 49f977d6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files
parent 928fbeee
No related branches found
No related tags found
No related merge requests found
module Issues
class CloseService < BaseService
class CloseService < Issues::BaseService
def execute(issue, commit = nil)
if issue.close
notification_service.close_issue(issue, current_user)
Loading
Loading
module Issues
class CreateService < BaseService
class CreateService < Issues::BaseService
def execute
issue = project.issues.new(params)
issue.author = current_user
Loading
Loading
module Issues
class ReopenService < BaseService
class ReopenService < Issues::BaseService
def execute(issue)
if issue.reopen
event_service.reopen_issue(issue, current_user)
Loading
Loading
module Issues
class UpdateService < BaseService
class UpdateService < Issues::BaseService
def execute(issue)
state = params.delete('state_event')
 
Loading
Loading
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment