Change all headers to X-Discourse-* instead of Discourse-*

This commit is contained in:
Robin Ward
2013-06-18 15:54:02 -04:00
parent 60fce196c7
commit 8af9952b25
6 changed files with 20 additions and 17 deletions
@@ -29,8 +29,8 @@ describe Email::MessageBuilder do
context "reply by email" do
context "without allow_reply_by_email" do
it "does not have a Discourse-Reply-Key" do
expect(header_args['Discourse-Reply-Key']).to be_blank
it "does not have a X-Discourse-Reply-Key" do
expect(header_args['X-Discourse-Reply-Key']).to be_blank
end
it "returns a Reply-To header that's the same as From" do
@@ -40,7 +40,7 @@ describe Email::MessageBuilder do
context "with allow_reply_by_email" do
let(:reply_by_email_builder) { Email::MessageBuilder.new(to_address, allow_reply_by_email: true) }
let(:reply_key) { reply_by_email_builder.header_args['Discourse-Reply-Key'] }
let(:reply_key) { reply_by_email_builder.header_args['X-Discourse-Reply-Key'] }
context "With the SiteSetting enabled" do
before do
@@ -48,7 +48,7 @@ describe Email::MessageBuilder do
SiteSetting.stubs(:reply_by_email_address).returns("r+%{reply_key}@reply.myforum.com")
end
it "has a Discourse-Reply-Key" do
it "has a X-Discourse-Reply-Key" do
expect(reply_key).to be_present
expect(reply_key.size).to eq(32)
end
@@ -63,7 +63,7 @@ describe Email::MessageBuilder do
SiteSetting.stubs(:reply_by_email_enabled?).returns(false)
end
it "has no Discourse-Reply-Key" do
it "has no X-Discourse-Reply-Key" do
expect(reply_key).to be_blank
end
@@ -83,11 +83,11 @@ describe Email::MessageBuilder do
post_id: 4567) }
it "passes through a post_id" do
expect(message_with_header_args.header_args['Discourse-Post-Id']).to eq('4567')
expect(message_with_header_args.header_args['X-Discourse-Post-Id']).to eq('4567')
end
it "passes through a topic_id" do
expect(message_with_header_args.header_args['Discourse-Topic-Id']).to eq('1234')
expect(message_with_header_args.header_args['X-Discourse-Topic-Id']).to eq('1234')
end
end
+3 -3
View File
@@ -51,8 +51,8 @@ describe Email::Sender do
context "email log with a post id and topic id" do
before do
message.header['Discourse-Post-Id'] = 3344
message.header['Discourse-Topic-Id'] = 5577
message.header['X-Discourse-Post-Id'] = 3344
message.header['X-Discourse-Topic-Id'] = 5577
end
let(:email_log) { EmailLog.last }
@@ -63,7 +63,7 @@ describe Email::Sender do
context "email log with a reply key" do
before do
message.header['Discourse-Reply-Key'] = reply_key
message.header['X-Discourse-Reply-Key'] = reply_key
end
let(:email_log) { EmailLog.last }
+1 -1
View File
@@ -2,7 +2,7 @@ require "spec_helper"
describe UserNotifications do
let(:user) { Fabricate(:user) }
let(:user) { Fabricate(:admin) }
describe ".signup" do
subject { UserNotifications.signup(user) }