Skip to content

Commit

Permalink
add new commenting secion for deliver_later_option and add a small te…
Browse files Browse the repository at this point in the history
…st case for deliver_later_option
  • Loading branch information
HexterCH committed Aug 28, 2016
1 parent 3f82f7c commit 5329b61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/generators/templates/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,9 @@
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
# so you need to do it manually. For the users scope, it would be:
# config.omniauth_path_prefix = '/my_engine/users/auth'

# ===> ActiveJob configuration
# If you want to use ActiveJob to diliver ActionMailer messages in the backgound,
# you can config deliver_later_option to true. Default is false
# config.deliver_later_option = true
end
8 changes: 8 additions & 0 deletions test/mailers/mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ def confirmation_instructions(record, token, opts = {})

assert mail.content_transfer_encoding, "7bit"
end

test "devise mailer should use deliver_later if deliver_later_option is true" do
swap Devise, deliver_later_option: true do
user = create_user
deliver_method = user.send(:delivery_method).to_s
assert_equal deliver_method, "deliver_later"
end
end
end

0 comments on commit 5329b61

Please sign in to comment.