Commit b510f8c4965b210cc1a583fc15dc09871669e1bf

Authored by Dmitriy Zaporozhets
1 parent 4398bdf2

Fixed tests

spec/observers/issue_observer_spec.rb
@@ -85,7 +85,7 @@ describe IssueObserver do @@ -85,7 +85,7 @@ describe IssueObserver do
85 85
86 it 'notification is delivered if the issue being closed' do 86 it 'notification is delivered if the issue being closed' do
87 issue.stub(:is_being_closed?).and_return(true) 87 issue.stub(:is_being_closed?).and_return(true)
88 - Notify.should_receive(:issue_status_changed_email).twice 88 + Notify.should_receive(:issue_status_changed_email).twice.and_return(stub(deliver: true))
89 Note.should_receive(:create_status_change_note).with(issue, some_user, 'closed') 89 Note.should_receive(:create_status_change_note).with(issue, some_user, 'closed')
90 90
91 subject.after_update(issue) 91 subject.after_update(issue)
@@ -104,7 +104,7 @@ describe IssueObserver do @@ -104,7 +104,7 @@ describe IssueObserver do
104 issue_without_assignee.stub(:is_being_reassigned?).and_return(false) 104 issue_without_assignee.stub(:is_being_reassigned?).and_return(false)
105 issue_without_assignee.stub(:is_being_closed?).and_return(true) 105 issue_without_assignee.stub(:is_being_closed?).and_return(true)
106 issue_without_assignee.stub(:is_being_reopened?).and_return(false) 106 issue_without_assignee.stub(:is_being_reopened?).and_return(false)
107 - Notify.should_receive(:issue_status_changed_email).once 107 + Notify.should_receive(:issue_status_changed_email).once.and_return(stub(deliver: true))
108 Note.should_receive(:create_status_change_note).with(issue_without_assignee, some_user, 'closed') 108 Note.should_receive(:create_status_change_note).with(issue_without_assignee, some_user, 'closed')
109 109
110 subject.after_update(issue_without_assignee) 110 subject.after_update(issue_without_assignee)
@@ -128,7 +128,7 @@ describe IssueObserver do @@ -128,7 +128,7 @@ describe IssueObserver do
128 128
129 it 'notification is delivered if the issue being reopened' do 129 it 'notification is delivered if the issue being reopened' do
130 issue.stub(:is_being_reopened?).and_return(true) 130 issue.stub(:is_being_reopened?).and_return(true)
131 - Notify.should_receive(:issue_status_changed_email).twice 131 + Notify.should_receive(:issue_status_changed_email).twice.and_return(stub(deliver: true))
132 Note.should_receive(:create_status_change_note).with(issue, some_user, 'reopened') 132 Note.should_receive(:create_status_change_note).with(issue, some_user, 'reopened')
133 133
134 subject.after_update(issue) 134 subject.after_update(issue)
@@ -147,7 +147,7 @@ describe IssueObserver do @@ -147,7 +147,7 @@ describe IssueObserver do
147 issue_without_assignee.stub(:is_being_reassigned?).and_return(false) 147 issue_without_assignee.stub(:is_being_reassigned?).and_return(false)
148 issue_without_assignee.stub(:is_being_closed?).and_return(false) 148 issue_without_assignee.stub(:is_being_closed?).and_return(false)
149 issue_without_assignee.stub(:is_being_reopened?).and_return(true) 149 issue_without_assignee.stub(:is_being_reopened?).and_return(true)
150 - Notify.should_receive(:issue_status_changed_email).once 150 + Notify.should_receive(:issue_status_changed_email).once.and_return(stub(deliver: true))
151 Note.should_receive(:create_status_change_note).with(issue_without_assignee, some_user, 'reopened') 151 Note.should_receive(:create_status_change_note).with(issue_without_assignee, some_user, 'reopened')
152 152
153 subject.after_update(issue_without_assignee) 153 subject.after_update(issue_without_assignee)
spec/tasks/gitlab/backup_rake_spec.rb
@@ -15,8 +15,8 @@ describe 'gitlab:app namespace rake task' do @@ -15,8 +15,8 @@ describe 'gitlab:app namespace rake task' do
15 end 15 end
16 16
17 let :run_rake_task do 17 let :run_rake_task do
18 - Rake::Task["gitlab:app:backup_restore"].reenable  
19 - Rake.application.invoke_task "gitlab:app:backup_restore" 18 + Rake::Task["gitlab:backup:restore"].reenable
  19 + Rake.application.invoke_task "gitlab:backup:restore"
20 end 20 end
21 21
22 context 'gitlab version' do 22 context 'gitlab version' do
@@ -36,8 +36,8 @@ describe 'gitlab:app namespace rake task' do @@ -36,8 +36,8 @@ describe 'gitlab:app namespace rake task' do
36 36
37 it 'should invoke restoration on mach' do 37 it 'should invoke restoration on mach' do
38 YAML.stub :load_file => {:gitlab_version => gitlab_version} 38 YAML.stub :load_file => {:gitlab_version => gitlab_version}
39 - Rake::Task["gitlab:app:db_restore"].should_receive :invoke  
40 - Rake::Task["gitlab:app:repo_restore"].should_receive :invoke 39 + Rake::Task["gitlab:backup:db:restore"].should_receive :invoke
  40 + Rake::Task["gitlab:backup:repo:restore"].should_receive :invoke
41 expect { run_rake_task }.to_not raise_error SystemExit 41 expect { run_rake_task }.to_not raise_error SystemExit
42 end 42 end
43 end 43 end