Commit 49f977d675b44b6aae0f491fbbf86dd1ee05eb64
1 parent
928fbeee
Exists in
spb-stable
and in
3 other branches
Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
5 changed files
with
5 additions
and
11 deletions
Show diff stats
app/services/issues/close_service.rb
| 1 | module Issues | 1 | module Issues |
| 2 | - class CloseService < BaseService | 2 | + class CloseService < Issues::BaseService |
| 3 | def execute(issue, commit = nil) | 3 | def execute(issue, commit = nil) |
| 4 | if issue.close | 4 | if issue.close |
| 5 | notification_service.close_issue(issue, current_user) | 5 | notification_service.close_issue(issue, current_user) |
app/services/issues/create_service.rb
app/services/issues/reopen_service.rb
app/services/issues/update_service.rb
spec/services/git_push_service_spec.rb
| @@ -170,16 +170,10 @@ describe GitPushService do | @@ -170,16 +170,10 @@ describe GitPushService do | ||
| 170 | Issue.find(issue.id).should be_closed | 170 | Issue.find(issue.id).should be_closed |
| 171 | end | 171 | end |
| 172 | 172 | ||
| 173 | - it "passes the closing commit as a thread-local" do | ||
| 174 | - service.execute(project, user, @oldrev, @newrev, @ref) | ||
| 175 | - | ||
| 176 | - Thread.current[:current_commit].should == closing_commit | ||
| 177 | - end | ||
| 178 | - | ||
| 179 | it "doesn't create cross-reference notes for a closing reference" do | 173 | it "doesn't create cross-reference notes for a closing reference" do |
| 180 | expect { | 174 | expect { |
| 181 | service.execute(project, user, @oldrev, @newrev, @ref) | 175 | service.execute(project, user, @oldrev, @newrev, @ref) |
| 182 | - }.not_to change { Note.where(project_id: project.id, system: true).count } | 176 | + }.not_to change { Note.where(project_id: project.id, system: true, commit_id: closing_commit.id).count } |
| 183 | end | 177 | end |
| 184 | 178 | ||
| 185 | it "doesn't close issues when pushed to non-default branches" do | 179 | it "doesn't close issues when pushed to non-default branches" do |