-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from jandudulski/backburner
Add support for Backburner backend
- Loading branch information
Showing
9 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
language: ruby | ||
rvm: | ||
- 1.9.3 | ||
services: | ||
- redis-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Devise | ||
module Async | ||
module Backend | ||
class Backburner < Base | ||
|
||
def self.enqueue(*args) | ||
args.unshift(self) | ||
::Backburner.enqueue(*args) | ||
end | ||
|
||
def self.perform(*args) | ||
new.perform(*args) | ||
end | ||
|
||
def self.queue | ||
Devise::Async.queue | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "test_helper" | ||
|
||
module Devise | ||
module Async | ||
module Backend | ||
describe "Backburner" do | ||
it "enqueues job" do | ||
::Backburner.expects(:enqueue).with(Backburner, :mailer_method, "User", 123, {}) | ||
Backburner.enqueue(:mailer_method, "User", 123, {}) | ||
end | ||
|
||
it "delegates to devise mailer when delivering" do | ||
user = create_user | ||
ActionMailer::Base.deliveries = [] | ||
Backend::Backburner.perform(:confirmation_instructions, "User", user.id, {}) | ||
ActionMailer::Base.deliveries.size.must_equal 1 | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters