Skip to content

Commit

Permalink
Auto correct rubocop offenses
Browse files Browse the repository at this point in the history
Offenses:

railties/lib/rails/autoloaders.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
module Rails
^
actionmailer/test/base_test.rb:917:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
actionmailer/test/base_test.rb:917:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
actionmailer/test/base_test.rb:917:5: C: [Corrected] Style/RedundantBegin: Redundant begin block detected.
    begin
    ^^^^^
actionmailer/test/base_test.rb:918:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
      events = []
  ^^^^
actionmailer/test/base_test.rb:930:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
actionmailer/test/base_test.rb:930:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
  • Loading branch information
yhirano55 committed Feb 17, 2019
1 parent fdc0595 commit ed3f315
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 10 additions & 12 deletions actionmailer/test/base_test.rb
Expand Up @@ -914,20 +914,18 @@ def a_callback
end

test "notification for deliver" do
begin
events = []
ActiveSupport::Notifications.subscribe("deliver.action_mailer") do |*args|
events << ActiveSupport::Notifications::Event.new(*args)
end
events = []
ActiveSupport::Notifications.subscribe("deliver.action_mailer") do |*args|
events << ActiveSupport::Notifications::Event.new(*args)
end

BaseMailer.welcome(body: "Hello there").deliver_now
BaseMailer.welcome(body: "Hello there").deliver_now

assert_equal 1, events.length
assert_equal "deliver.action_mailer", events[0].name
assert_not_nil events[0].payload[:message_id]
ensure
ActiveSupport::Notifications.unsubscribe "deliver.action_mailer"
end
assert_equal 1, events.length
assert_equal "deliver.action_mailer", events[0].name
assert_not_nil events[0].payload[:message_id]
ensure
ActiveSupport::Notifications.unsubscribe "deliver.action_mailer"
end

private
Expand Down
2 changes: 2 additions & 0 deletions railties/lib/rails/autoloaders.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rails
module Autoloaders # :nodoc:
class << self
Expand Down

0 comments on commit ed3f315

Please sign in to comment.