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 85  
86 86 it 'notification is delivered if the issue being closed' do
87 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 89 Note.should_receive(:create_status_change_note).with(issue, some_user, 'closed')
90 90  
91 91 subject.after_update(issue)
... ... @@ -104,7 +104,7 @@ describe IssueObserver do
104 104 issue_without_assignee.stub(:is_being_reassigned?).and_return(false)
105 105 issue_without_assignee.stub(:is_being_closed?).and_return(true)
106 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 108 Note.should_receive(:create_status_change_note).with(issue_without_assignee, some_user, 'closed')
109 109  
110 110 subject.after_update(issue_without_assignee)
... ... @@ -128,7 +128,7 @@ describe IssueObserver do
128 128  
129 129 it 'notification is delivered if the issue being reopened' do
130 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 132 Note.should_receive(:create_status_change_note).with(issue, some_user, 'reopened')
133 133  
134 134 subject.after_update(issue)
... ... @@ -147,7 +147,7 @@ describe IssueObserver do
147 147 issue_without_assignee.stub(:is_being_reassigned?).and_return(false)
148 148 issue_without_assignee.stub(:is_being_closed?).and_return(false)
149 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 151 Note.should_receive(:create_status_change_note).with(issue_without_assignee, some_user, 'reopened')
152 152  
153 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 15 end
16 16  
17 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 20 end
21 21  
22 22 context 'gitlab version' do
... ... @@ -36,8 +36,8 @@ describe 'gitlab:app namespace rake task' do
36 36  
37 37 it 'should invoke restoration on mach' do
38 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 41 expect { run_rake_task }.to_not raise_error SystemExit
42 42 end
43 43 end
... ...