Commit a5104f32a12b1d0a2cd93af65d869b7e995e457a
1 parent
df414015
Exists in
master
and in
1 other branch
upgrade to rails 4.2
Showing
16 changed files
with
89 additions
and
63 deletions
Show diff stats
.travis.yml
@@ -6,7 +6,7 @@ rvm: | @@ -6,7 +6,7 @@ rvm: | ||
6 | - ruby-head | 6 | - ruby-head |
7 | - jruby-head | 7 | - jruby-head |
8 | env: | 8 | env: |
9 | - - RAILS_ENV=test COVERAGE=true JRUBY_OPTS=--debug | 9 | + - COVERAGE=true JRUBY_OPTS=--debug |
10 | sudo: false | 10 | sudo: false |
11 | cache: bundler | 11 | cache: bundler |
12 | before_script: | 12 | before_script: |
Gemfile
1 | source 'https://rubygems.org' | 1 | source 'https://rubygems.org' |
2 | 2 | ||
3 | -RAILS_VERSION = '~> 4.1.11' | 3 | +RAILS_VERSION = '~> 4.2.0' |
4 | 4 | ||
5 | send :ruby, ENV['GEMFILE_RUBY_VERSION'] if ENV['GEMFILE_RUBY_VERSION'] | 5 | send :ruby, ENV['GEMFILE_RUBY_VERSION'] if ENV['GEMFILE_RUBY_VERSION'] |
6 | 6 | ||
@@ -81,7 +81,7 @@ group :test do | @@ -81,7 +81,7 @@ group :test do | ||
81 | gem 'rspec-rails', '~> 3.0', require: false | 81 | gem 'rspec-rails', '~> 3.0', require: false |
82 | gem 'rspec-activemodel-mocks' | 82 | gem 'rspec-activemodel-mocks' |
83 | gem 'rspec-its' | 83 | gem 'rspec-its' |
84 | - gem 'mongoid-rspec', require: false | 84 | + gem 'mongoid-rspec', '~> 2.3.0.beta', require: false |
85 | gem 'fabrication' | 85 | gem 'fabrication' |
86 | gem 'capybara' | 86 | gem 'capybara' |
87 | gem 'poltergeist' | 87 | gem 'poltergeist' |
Gemfile.lock
1 | GEM | 1 | GEM |
2 | remote: https://rubygems.org/ | 2 | remote: https://rubygems.org/ |
3 | specs: | 3 | specs: |
4 | - actionmailer (4.1.12) | ||
5 | - actionpack (= 4.1.12) | ||
6 | - actionview (= 4.1.12) | 4 | + actionmailer (4.2.3) |
5 | + actionpack (= 4.2.3) | ||
6 | + actionview (= 4.2.3) | ||
7 | + activejob (= 4.2.3) | ||
7 | mail (~> 2.5, >= 2.5.4) | 8 | mail (~> 2.5, >= 2.5.4) |
9 | + rails-dom-testing (~> 1.0, >= 1.0.5) | ||
8 | actionmailer_inline_css (1.5.3) | 10 | actionmailer_inline_css (1.5.3) |
9 | actionmailer (>= 3.0.0) | 11 | actionmailer (>= 3.0.0) |
10 | nokogiri (>= 1.4.4) | 12 | nokogiri (>= 1.4.4) |
11 | premailer (>= 1.7.1) | 13 | premailer (>= 1.7.1) |
12 | - actionpack (4.1.12) | ||
13 | - actionview (= 4.1.12) | ||
14 | - activesupport (= 4.1.12) | ||
15 | - rack (~> 1.5.2) | 14 | + actionpack (4.2.3) |
15 | + actionview (= 4.2.3) | ||
16 | + activesupport (= 4.2.3) | ||
17 | + rack (~> 1.6) | ||
16 | rack-test (~> 0.6.2) | 18 | rack-test (~> 0.6.2) |
17 | - actionview (4.1.12) | ||
18 | - activesupport (= 4.1.12) | 19 | + rails-dom-testing (~> 1.0, >= 1.0.5) |
20 | + rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
21 | + actionview (4.2.3) | ||
22 | + activesupport (= 4.2.3) | ||
19 | builder (~> 3.1) | 23 | builder (~> 3.1) |
20 | erubis (~> 2.7.0) | 24 | erubis (~> 2.7.0) |
21 | - activemodel (4.1.12) | ||
22 | - activesupport (= 4.1.12) | 25 | + rails-dom-testing (~> 1.0, >= 1.0.5) |
26 | + rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
27 | + activejob (4.2.3) | ||
28 | + activesupport (= 4.2.3) | ||
29 | + globalid (>= 0.3.0) | ||
30 | + activemodel (4.2.3) | ||
31 | + activesupport (= 4.2.3) | ||
23 | builder (~> 3.1) | 32 | builder (~> 3.1) |
24 | - activerecord (4.1.12) | ||
25 | - activemodel (= 4.1.12) | ||
26 | - activesupport (= 4.1.12) | ||
27 | - arel (~> 5.0.0) | ||
28 | - activesupport (4.1.12) | ||
29 | - i18n (~> 0.6, >= 0.6.9) | 33 | + activerecord (4.2.3) |
34 | + activemodel (= 4.2.3) | ||
35 | + activesupport (= 4.2.3) | ||
36 | + arel (~> 6.0) | ||
37 | + activesupport (4.2.3) | ||
38 | + i18n (~> 0.7) | ||
30 | json (~> 1.7, >= 1.7.7) | 39 | json (~> 1.7, >= 1.7.7) |
31 | minitest (~> 5.1) | 40 | minitest (~> 5.1) |
32 | - thread_safe (~> 0.1) | 41 | + thread_safe (~> 0.3, >= 0.3.4) |
33 | tzinfo (~> 1.1) | 42 | tzinfo (~> 1.1) |
34 | addressable (2.3.8) | 43 | addressable (2.3.8) |
35 | airbrake (4.3.0) | 44 | airbrake (4.3.0) |
36 | builder | 45 | builder |
37 | multi_json | 46 | multi_json |
38 | - arel (5.0.1.20140414130214) | 47 | + arel (6.0.3) |
39 | bcrypt (3.1.10) | 48 | bcrypt (3.1.10) |
40 | bcrypt (3.1.10-java) | 49 | bcrypt (3.1.10-java) |
41 | better_errors (2.1.1) | 50 | better_errors (2.1.1) |
@@ -127,6 +136,8 @@ GEM | @@ -127,6 +136,8 @@ GEM | ||
127 | flowdock (0.6.0) | 136 | flowdock (0.6.0) |
128 | httparty (~> 0.7) | 137 | httparty (~> 0.7) |
129 | multi_json | 138 | multi_json |
139 | + globalid (0.3.6) | ||
140 | + activesupport (>= 4.1.0) | ||
130 | haml (4.0.6) | 141 | haml (4.0.6) |
131 | tilt | 142 | tilt |
132 | hashie (3.4.2) | 143 | hashie (3.4.2) |
@@ -162,6 +173,8 @@ GEM | @@ -162,6 +173,8 @@ GEM | ||
162 | addressable (~> 2.3) | 173 | addressable (~> 2.3) |
163 | spoon (~> 0.0.1) | 174 | spoon (~> 0.0.1) |
164 | libv8 (3.16.14.7) | 175 | libv8 (3.16.14.7) |
176 | + loofah (2.0.3) | ||
177 | + nokogiri (>= 1.5.9) | ||
165 | mail (2.6.3) | 178 | mail (2.6.3) |
166 | mime-types (>= 1.16, < 3) | 179 | mime-types (>= 1.16, < 3) |
167 | meta_request (0.3.4) | 180 | meta_request (0.3.4) |
@@ -172,7 +185,7 @@ GEM | @@ -172,7 +185,7 @@ GEM | ||
172 | mime-types (2.6.1) | 185 | mime-types (2.6.1) |
173 | mimemagic (0.3.0) | 186 | mimemagic (0.3.0) |
174 | mini_portile (0.6.2) | 187 | mini_portile (0.6.2) |
175 | - minitest (5.7.0) | 188 | + minitest (5.8.0) |
176 | mongo (2.1.0.beta) | 189 | mongo (2.1.0.beta) |
177 | bson (~> 3.0) | 190 | bson (~> 3.0) |
178 | mongoid (5.0.0.beta) | 191 | mongoid (5.0.0.beta) |
@@ -180,10 +193,10 @@ GEM | @@ -180,10 +193,10 @@ GEM | ||
180 | mongo (= 2.1.0.beta) | 193 | mongo (= 2.1.0.beta) |
181 | origin (~> 2.1) | 194 | origin (~> 2.1) |
182 | tzinfo (>= 0.3.37) | 195 | tzinfo (>= 0.3.37) |
183 | - mongoid-rspec (1.10.0) | ||
184 | - mongoid (>= 3.0.1) | 196 | + mongoid-rspec (2.3.0.beta) |
197 | + mongoid (= 5.0.0.beta) | ||
185 | rake | 198 | rake |
186 | - rspec (>= 2.14) | 199 | + rspec (~> 3.3) |
187 | mongoid_rails_migrations (1.0.1) | 200 | mongoid_rails_migrations (1.0.1) |
188 | activesupport (>= 3.2.0) | 201 | activesupport (>= 3.2.0) |
189 | bundler (>= 1.0.0) | 202 | bundler (>= 1.0.0) |
@@ -246,7 +259,7 @@ GEM | @@ -246,7 +259,7 @@ GEM | ||
246 | pry (>= 0.9.10) | 259 | pry (>= 0.9.10) |
247 | quiet_assets (1.1.0) | 260 | quiet_assets (1.1.0) |
248 | railties (>= 3.1, < 5.0) | 261 | railties (>= 3.1, < 5.0) |
249 | - rack (1.5.5) | 262 | + rack (1.6.4) |
250 | rack-contrib (1.2.0) | 263 | rack-contrib (1.2.0) |
251 | rack (>= 0.9.1) | 264 | rack (>= 0.9.1) |
252 | rack-ssl (1.4.1) | 265 | rack-ssl (1.4.1) |
@@ -254,16 +267,25 @@ GEM | @@ -254,16 +267,25 @@ GEM | ||
254 | rack-ssl-enforcer (0.2.8) | 267 | rack-ssl-enforcer (0.2.8) |
255 | rack-test (0.6.3) | 268 | rack-test (0.6.3) |
256 | rack (>= 1.0) | 269 | rack (>= 1.0) |
257 | - rails (4.1.12) | ||
258 | - actionmailer (= 4.1.12) | ||
259 | - actionpack (= 4.1.12) | ||
260 | - actionview (= 4.1.12) | ||
261 | - activemodel (= 4.1.12) | ||
262 | - activerecord (= 4.1.12) | ||
263 | - activesupport (= 4.1.12) | 270 | + rails (4.2.3) |
271 | + actionmailer (= 4.2.3) | ||
272 | + actionpack (= 4.2.3) | ||
273 | + actionview (= 4.2.3) | ||
274 | + activejob (= 4.2.3) | ||
275 | + activemodel (= 4.2.3) | ||
276 | + activerecord (= 4.2.3) | ||
277 | + activesupport (= 4.2.3) | ||
264 | bundler (>= 1.3.0, < 2.0) | 278 | bundler (>= 1.3.0, < 2.0) |
265 | - railties (= 4.1.12) | ||
266 | - sprockets-rails (~> 2.0) | 279 | + railties (= 4.2.3) |
280 | + sprockets-rails | ||
281 | + rails-deprecated_sanitizer (1.0.3) | ||
282 | + activesupport (>= 4.2.0.alpha) | ||
283 | + rails-dom-testing (1.0.7) | ||
284 | + activesupport (>= 4.2.0.beta, < 5.0) | ||
285 | + nokogiri (~> 1.6.0) | ||
286 | + rails-deprecated_sanitizer (>= 1.0.1) | ||
287 | + rails-html-sanitizer (1.0.2) | ||
288 | + loofah (~> 2.0) | ||
267 | rails_12factor (0.0.3) | 289 | rails_12factor (0.0.3) |
268 | rails_serve_static_assets | 290 | rails_serve_static_assets |
269 | rails_stdout_logging | 291 | rails_stdout_logging |
@@ -271,17 +293,17 @@ GEM | @@ -271,17 +293,17 @@ GEM | ||
271 | rails (> 3.1) | 293 | rails (> 3.1) |
272 | rails_serve_static_assets (0.0.4) | 294 | rails_serve_static_assets (0.0.4) |
273 | rails_stdout_logging (0.0.3) | 295 | rails_stdout_logging (0.0.3) |
274 | - railties (4.1.12) | ||
275 | - actionpack (= 4.1.12) | ||
276 | - activesupport (= 4.1.12) | 296 | + railties (4.2.3) |
297 | + actionpack (= 4.2.3) | ||
298 | + activesupport (= 4.2.3) | ||
277 | rake (>= 0.8.7) | 299 | rake (>= 0.8.7) |
278 | thor (>= 0.18.1, < 2.0) | 300 | thor (>= 0.18.1, < 2.0) |
279 | raindrops (0.13.0) | 301 | raindrops (0.13.0) |
280 | rake (10.4.2) | 302 | rake (10.4.2) |
281 | ref (1.0.5) | 303 | ref (1.0.5) |
282 | request_store (1.1.0) | 304 | request_store (1.1.0) |
283 | - responders (1.1.2) | ||
284 | - railties (>= 3.2, < 4.2) | 305 | + responders (2.1.0) |
306 | + railties (>= 4.2.0, < 5) | ||
285 | rest-client (1.8.0) | 307 | rest-client (1.8.0) |
286 | http-cookie (>= 1.0.2, < 2.0) | 308 | http-cookie (>= 1.0.2, < 2.0) |
287 | mime-types (>= 1.16, < 3.0) | 309 | mime-types (>= 1.16, < 3.0) |
@@ -336,7 +358,7 @@ GEM | @@ -336,7 +358,7 @@ GEM | ||
336 | slop (3.6.0) | 358 | slop (3.6.0) |
337 | spoon (0.0.4) | 359 | spoon (0.0.4) |
338 | ffi | 360 | ffi |
339 | - sprockets (3.2.0) | 361 | + sprockets (3.3.3) |
340 | rack (~> 1.0) | 362 | rack (~> 1.0) |
341 | sprockets-rails (2.3.2) | 363 | sprockets-rails (2.3.2) |
342 | actionpack (>= 3.0) | 364 | actionpack (>= 3.0) |
@@ -391,9 +413,9 @@ PLATFORMS | @@ -391,9 +413,9 @@ PLATFORMS | ||
391 | ruby | 413 | ruby |
392 | 414 | ||
393 | DEPENDENCIES | 415 | DEPENDENCIES |
394 | - actionmailer (~> 4.1.11) | 416 | + actionmailer (~> 4.2.0) |
395 | actionmailer_inline_css | 417 | actionmailer_inline_css |
396 | - actionpack (~> 4.1.11) | 418 | + actionpack (~> 4.2.0) |
397 | airbrake | 419 | airbrake |
398 | better_errors | 420 | better_errors |
399 | binding_of_caller | 421 | binding_of_caller |
@@ -426,7 +448,7 @@ DEPENDENCIES | @@ -426,7 +448,7 @@ DEPENDENCIES | ||
426 | launchy | 448 | launchy |
427 | meta_request | 449 | meta_request |
428 | mongoid (= 5.0.0.beta) | 450 | mongoid (= 5.0.0.beta) |
429 | - mongoid-rspec | 451 | + mongoid-rspec (~> 2.3.0.beta) |
430 | mongoid_rails_migrations | 452 | mongoid_rails_migrations |
431 | omniauth-github | 453 | omniauth-github |
432 | pjax_rails | 454 | pjax_rails |
@@ -438,7 +460,7 @@ DEPENDENCIES | @@ -438,7 +460,7 @@ DEPENDENCIES | ||
438 | rack-ssl-enforcer | 460 | rack-ssl-enforcer |
439 | rails_12factor | 461 | rails_12factor |
440 | rails_autolink | 462 | rails_autolink |
441 | - railties (~> 4.1.11) | 463 | + railties (~> 4.2.0) |
442 | ri_cal | 464 | ri_cal |
443 | rspec (~> 3.3) | 465 | rspec (~> 3.3) |
444 | rspec-activemodel-mocks | 466 | rspec-activemodel-mocks |
app/controllers/api/v3/notices_controller.rb
@@ -13,10 +13,9 @@ class Api::V3::NoticesController < ApplicationController | @@ -13,10 +13,9 @@ class Api::V3::NoticesController < ApplicationController | ||
13 | report.generate_notice! | 13 | report.generate_notice! |
14 | render json: { | 14 | render json: { |
15 | id: report.notice.id, | 15 | id: report.notice.id, |
16 | - url: app_problem_path( | 16 | + url: app_problem_url( |
17 | report.app, | 17 | report.app, |
18 | - report.error.problem_id, | ||
19 | - only_path: false) | 18 | + report.error.problem_id) |
20 | } | 19 | } |
21 | else | 20 | else |
22 | render text: 'Notice for old app version ignored' | 21 | render text: 'Notice for old app version ignored' |
app/models/comment.rb
@@ -17,7 +17,7 @@ class Comment | @@ -17,7 +17,7 @@ class Comment | ||
17 | validates_presence_of :body | 17 | validates_presence_of :body |
18 | 18 | ||
19 | def deliver_email | 19 | def deliver_email |
20 | - Mailer.comment_notification(self).deliver | 20 | + Mailer.comment_notification(self).deliver_now |
21 | end | 21 | end |
22 | 22 | ||
23 | def notification_recipients | 23 | def notification_recipients |
app/models/deploy.rb
@@ -40,7 +40,7 @@ class Deploy | @@ -40,7 +40,7 @@ class Deploy | ||
40 | 40 | ||
41 | def deliver_email | 41 | def deliver_email |
42 | if app.notify_on_deploys? && app.notification_recipients.any? | 42 | if app.notify_on_deploys? && app.notification_recipients.any? |
43 | - Mailer.deploy_notification(self).deliver | 43 | + Mailer.deploy_notification(self).deliver_now |
44 | end | 44 | end |
45 | end | 45 | end |
46 | 46 |
app/models/error_report.rb
@@ -85,7 +85,7 @@ class ErrorReport | @@ -85,7 +85,7 @@ class ErrorReport | ||
85 | def email_notification | 85 | def email_notification |
86 | return false unless app.emailable? | 86 | return false unless app.emailable? |
87 | return false unless app.email_at_notices.include?(@problem.notices_count) | 87 | return false unless app.email_at_notices.include?(@problem.notices_count) |
88 | - Mailer.err_notification(self).deliver | 88 | + Mailer.err_notification(self).deliver_now |
89 | rescue => e | 89 | rescue => e |
90 | HoptoadNotifier.notify(e) | 90 | HoptoadNotifier.notify(e) |
91 | end | 91 | end |
config/application.rb
@@ -20,7 +20,7 @@ module Errbit | @@ -20,7 +20,7 @@ module Errbit | ||
20 | 20 | ||
21 | config.before_initialize do | 21 | config.before_initialize do |
22 | config.secret_key_base = Errbit::Config.secret_key_base | 22 | config.secret_key_base = Errbit::Config.secret_key_base |
23 | - config.serve_static_assets = Errbit::Config.serve_static_assets | 23 | + config.serve_static_files = Errbit::Config.serve_static_assets |
24 | end | 24 | end |
25 | 25 | ||
26 | initializer 'errbit.mongoid', before: 'mongoid.load-config' do | 26 | initializer 'errbit.mongoid', before: 'mongoid.load-config' do |
config/environments/test.rb
@@ -13,7 +13,7 @@ Rails.application.configure do | @@ -13,7 +13,7 @@ Rails.application.configure do | ||
13 | config.eager_load = false | 13 | config.eager_load = false |
14 | 14 | ||
15 | # Configure static asset server for tests with Cache-Control for performance. | 15 | # Configure static asset server for tests with Cache-Control for performance. |
16 | - config.serve_static_assets = true | 16 | + config.serve_static_files = true |
17 | config.static_cache_control = 'public, max-age=3600' | 17 | config.static_cache_control = 'public, max-age=3600' |
18 | 18 | ||
19 | # Show full error reports and disable caching. | 19 | # Show full error reports and disable caching. |
spec/controllers/api/v3/notices_controller_spec.rb
@@ -11,7 +11,7 @@ describe Api::V3::NoticesController, type: :controller do | @@ -11,7 +11,7 @@ describe Api::V3::NoticesController, type: :controller do | ||
11 | notice = Notice.last | 11 | notice = Notice.last |
12 | expect(JSON.parse(response.body)).to eq({ | 12 | expect(JSON.parse(response.body)).to eq({ |
13 | 'id' => notice.id.to_s, | 13 | 'id' => notice.id.to_s, |
14 | - 'url' => app_problem_path(app, notice.problem, only_path: false) | 14 | + 'url' => app_problem_url(app, notice.problem) |
15 | }) | 15 | }) |
16 | end | 16 | end |
17 | 17 |
spec/initializers/action_mailer_spec.rb
@@ -3,6 +3,10 @@ describe 'initializers/action_mailer' do | @@ -3,6 +3,10 @@ describe 'initializers/action_mailer' do | ||
3 | load File.join(Rails.root, 'config', 'initializers', 'action_mailer.rb') | 3 | load File.join(Rails.root, 'config', 'initializers', 'action_mailer.rb') |
4 | end | 4 | end |
5 | 5 | ||
6 | + after do | ||
7 | + ActionMailer::Base.delivery_method = :test | ||
8 | + end | ||
9 | + | ||
6 | describe 'delivery method' do | 10 | describe 'delivery method' do |
7 | it 'sets the delivery method to :smtp' do | 11 | it 'sets the delivery method to :smtp' do |
8 | allow(Errbit::Config).to receive(:email_delivery_method).and_return(:smtp) | 12 | allow(Errbit::Config).to receive(:email_delivery_method).and_return(:smtp) |
spec/mailers/mailer_spec.rb
@@ -61,7 +61,7 @@ describe Mailer do | @@ -61,7 +61,7 @@ describe Mailer do | ||
61 | ) | 61 | ) |
62 | end | 62 | end |
63 | let(:email) do | 63 | let(:email) do |
64 | - Mailer.err_notification(error_report).deliver | 64 | + Mailer.err_notification(error_report).deliver_now |
65 | end | 65 | end |
66 | 66 | ||
67 | before { email } | 67 | before { email } |
@@ -77,7 +77,7 @@ describe Mailer do | @@ -77,7 +77,7 @@ describe Mailer do | ||
77 | end | 77 | end |
78 | 78 | ||
79 | it "should have links to source files" do | 79 | it "should have links to source files" do |
80 | - expect(email).to have_body_text('<a href="http://example.com/path/to/file.js" target="_blank">path/to/file.js') | 80 | + expect(email).to have_body_text('<a target="_blank" href="http://example.com/path/to/file.js">path/to/file.js') |
81 | end | 81 | end |
82 | 82 | ||
83 | it "should have the error count in the subject" do | 83 | it "should have the error count in the subject" do |
@@ -104,7 +104,7 @@ describe Mailer do | @@ -104,7 +104,7 @@ describe Mailer do | ||
104 | before do | 104 | before do |
105 | expect(comment).to receive(:notification_recipients).and_return(recipients) | 105 | expect(comment).to receive(:notification_recipients).and_return(recipients) |
106 | Fabricate(:notice, :err => notice.err) | 106 | Fabricate(:notice, :err => notice.err) |
107 | - @email = Mailer.comment_notification(comment).deliver | 107 | + @email = Mailer.comment_notification(comment).deliver_now |
108 | end | 108 | end |
109 | 109 | ||
110 | it "should be sent to comment notification recipients" do | 110 | it "should be sent to comment notification recipients" do |
spec/models/comment_observer_spec.rb
@@ -8,7 +8,7 @@ describe "Callback on Comment", type: 'model' do | @@ -8,7 +8,7 @@ describe "Callback on Comment", type: 'model' do | ||
8 | it 'should send an email notification' do | 8 | it 'should send an email notification' do |
9 | expect(Mailer).to receive(:comment_notification). | 9 | expect(Mailer).to receive(:comment_notification). |
10 | with(comment). | 10 | with(comment). |
11 | - and_return(double('email', :deliver => true)) | 11 | + and_return(double('email', :deliver_now => true)) |
12 | comment.save | 12 | comment.save |
13 | end | 13 | end |
14 | end | 14 | end |
spec/models/deploy_observer_spec.rb
@@ -3,7 +3,7 @@ describe "Callback on Deploy", type: 'model' do | @@ -3,7 +3,7 @@ describe "Callback on Deploy", type: 'model' do | ||
3 | context 'and the app should notify on deploys' do | 3 | context 'and the app should notify on deploys' do |
4 | it 'should send an email notification' do | 4 | it 'should send an email notification' do |
5 | expect(Mailer).to receive(:deploy_notification). | 5 | expect(Mailer).to receive(:deploy_notification). |
6 | - and_return(double('email', :deliver => true)) | 6 | + and_return(double('email', :deliver_now => true)) |
7 | Fabricate(:deploy, :app => Fabricate(:app_with_watcher, :notify_on_deploys => true)) | 7 | Fabricate(:deploy, :app => Fabricate(:app_with_watcher, :notify_on_deploys => true)) |
8 | end | 8 | end |
9 | end | 9 | end |
spec/models/notice_observer_spec.rb
@@ -49,7 +49,7 @@ describe "Callback on Notice", type: 'model' do | @@ -49,7 +49,7 @@ describe "Callback on Notice", type: 'model' do | ||
49 | @problem.update_attributes notices_count: threshold - 1 | 49 | @problem.update_attributes notices_count: threshold - 1 |
50 | 50 | ||
51 | expect(Mailer).to receive(:err_notification). | 51 | expect(Mailer).to receive(:err_notification). |
52 | - and_return(double('email', :deliver => true)) | 52 | + and_return(double('email', :deliver_now => true)) |
53 | 53 | ||
54 | error_report = ErrorReport.new(notice_attrs) | 54 | error_report = ErrorReport.new(notice_attrs) |
55 | error_report.generate_notice! | 55 | error_report.generate_notice! |
@@ -95,7 +95,7 @@ describe "Callback on Notice", type: 'model' do | @@ -95,7 +95,7 @@ describe "Callback on Notice", type: 'model' do | ||
95 | err.problem.resolve! | 95 | err.problem.resolve! |
96 | 96 | ||
97 | expect(Mailer).to receive(:err_notification) | 97 | expect(Mailer).to receive(:err_notification) |
98 | - .and_return(double('email', :deliver => true)) | 98 | + .and_return(double('email', :deliver_now => true)) |
99 | 99 | ||
100 | ErrorReport.new(notice_attrs).generate_notice! | 100 | ErrorReport.new(notice_attrs).generate_notice! |
101 | end | 101 | end |
@@ -121,7 +121,7 @@ describe "Callback on Notice", type: 'model' do | @@ -121,7 +121,7 @@ describe "Callback on Notice", type: 'model' do | ||
121 | expect(error_report.app.notification_service) | 121 | expect(error_report.app.notification_service) |
122 | .to receive(:create_notification).and_raise(ArgumentError) | 122 | .to receive(:create_notification).and_raise(ArgumentError) |
123 | expect(Mailer) | 123 | expect(Mailer) |
124 | - .to receive(:err_notification).and_return(double(:deliver => true)) | 124 | + .to receive(:err_notification).and_return(double(:deliver_now => true)) |
125 | 125 | ||
126 | error_report.generate_notice! | 126 | error_report.generate_notice! |
127 | end | 127 | end |
spec/spec_helper.rb
@@ -33,6 +33,7 @@ require 'errbit_plugin/mock_issue_tracker' | @@ -33,6 +33,7 @@ require 'errbit_plugin/mock_issue_tracker' | ||
33 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} | 33 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} |
34 | Mongoid::Config.truncate! | 34 | Mongoid::Config.truncate! |
35 | Mongoid::Tasks::Database.create_indexes | 35 | Mongoid::Tasks::Database.create_indexes |
36 | +ActionMailer::Base.delivery_method = :test | ||
36 | 37 | ||
37 | RSpec.configure do |config| | 38 | RSpec.configure do |config| |
38 | config.include Devise::TestHelpers, :type => :controller | 39 | config.include Devise::TestHelpers, :type => :controller |