forked from ryanb/railscasts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
email author when responding to their comment - closes ryanb#30
- Loading branch information
Showing
14 changed files
with
118 additions
and
4 deletions.
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
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,9 @@ | ||
Someone has responded to your comment on RailsCasts. Here is the response. | ||
|
||
--- | ||
From: <%= raw @comment.user.name %> | ||
<%= raw @comment.content %> | ||
--- | ||
|
||
To view the full comment: <%= episode_url(@comment.episode, :view => "comments") %> |
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
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,29 @@ | ||
require "spec_helper" | ||
|
||
describe Mailer do | ||
describe "feedback" do | ||
let(:message) { Factory(:feedback_message) } | ||
let(:mail) { Mailer.feedback(message) } | ||
|
||
it "includes message with name and email" do | ||
mail.subject.should eq("RailsCasts Feedback from #{message.name}") | ||
mail.to.should eq(["feedback@railscasts.com"]) | ||
mail.from.should eq([message.email]) | ||
mail.body.encoded.should match(message.content) | ||
end | ||
end | ||
|
||
describe "comment_response" do | ||
let(:user) { Factory(:user) } | ||
let(:comment) { Factory(:comment) } | ||
let(:mail) { Mailer.comment_response(comment, user) } | ||
|
||
it "includes comment content and link to comment page" do | ||
mail.subject.should eq("Comment Response on RailsCasts") | ||
mail.to.should eq([user.email]) | ||
mail.from.should eq(["noreply@railscasts.com"]) | ||
mail.body.encoded.should include(comment.content) | ||
mail.body.encoded.should include(episode_url(comment.episode, :view => "comments")) | ||
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
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,6 +1,12 @@ | ||
module AuthMacros | ||
def login(user) | ||
def login(user = nil) | ||
user ||= Factory(:user) | ||
OmniAuth.config.add_mock(:github, "uid" => user.github_uid) | ||
visit login_path | ||
@_current_user = user | ||
end | ||
|
||
def current_user | ||
@_current_user | ||
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,13 @@ | ||
module MailerMacros | ||
def last_email | ||
ActionMailer::Base.deliveries.last | ||
end | ||
|
||
def reset_email | ||
ActionMailer::Base.deliveries = [] | ||
end | ||
|
||
def email_count | ||
ActionMailer::Base.deliveries.size | ||
end | ||
end |