FIX: Partial reply key search in email sent logs.

Follow up to c85b9c6ed3a847ce0df7d58340d6680536d92b90
This commit is contained in:
Guo Xiang Tan
2019-01-10 09:21:28 +08:00
parent 35b59cfa78
commit e9b2018bc8
7 changed files with 32 additions and 16 deletions

View File

@ -103,8 +103,7 @@ describe EmailLog do
.pluck("bounce_key::text")
.first
expect(raw_key).to_not eq(hex)
expect(raw_key.delete('-')).to eq(hex)
expect(raw_key).to eq(hex)
expect(EmailLog.find(email_log.id).bounce_key).to eq(hex)
end
end

View File

@ -3,7 +3,7 @@ require 'rails_helper'
RSpec.describe PostReplyKey do
describe "#reply_key" do
it "should format the reply_key correctly" do
hex = SecureRandom.hex
hex = SecureRandom.uuid
post_reply_key = Fabricate(:post_reply_key,
reply_key: hex
)
@ -12,8 +12,7 @@ RSpec.describe PostReplyKey do
.pluck("reply_key::text")
.first
expect(raw_key).to_not eq(hex)
expect(raw_key.delete('-')).to eq(hex)
expect(raw_key).to eq(hex)
expect(PostReplyKey.find(post_reply_key.id).reply_key).to eq(hex)
end
end