mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: allow an admin to click on blank errors (#5027)
* FIX: allow an admin to click on blank errors * i18nlize strings * what would a rails master do?
This commit is contained in:
@@ -66,9 +66,9 @@ describe Email::Processor do
|
||||
Rails.logger.expects(:error)
|
||||
|
||||
Email::Processor.process!(mail)
|
||||
expect(IncomingEmail.first.error).to eq("boom")
|
||||
expect(IncomingEmail.first.rejection_message).to be_present
|
||||
expect(EmailLog.first.email_type).to eq("email_reject_unrecognized_error")
|
||||
expect(IncomingEmail.last.error).to eq("boom")
|
||||
expect(IncomingEmail.last.rejection_message).to be_present
|
||||
expect(EmailLog.last.email_type).to eq("email_reject_unrecognized_error")
|
||||
end
|
||||
|
||||
it "sends more than one rejection email per day" do
|
||||
|
||||
@@ -81,4 +81,22 @@ describe Admin::EmailController do
|
||||
end
|
||||
end
|
||||
|
||||
context '.rejected' do
|
||||
it 'should provide a string for a blank error' do
|
||||
Fabricate(:incoming_email, error: "")
|
||||
xhr :get, :rejected
|
||||
rejected = JSON.parse(response.body)
|
||||
expect(rejected.first['error']).to eq(I18n.t("emails.incoming.unrecognized_error"))
|
||||
end
|
||||
end
|
||||
|
||||
context '.incoming' do
|
||||
it 'should provide a string for a blank error' do
|
||||
incoming_email = Fabricate(:incoming_email, error: "")
|
||||
xhr :get, :incoming, id: incoming_email.id
|
||||
incoming = JSON.parse(response.body)
|
||||
expect(incoming['error']).to eq(I18n.t("emails.incoming.unrecognized_error"))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
1
spec/fabricators/incoming_email_fabricator.rb
Normal file
1
spec/fabricators/incoming_email_fabricator.rb
Normal file
@@ -0,0 +1 @@
|
||||
Fabricator(:incoming_email)
|
||||
Reference in New Issue
Block a user