]
attr_accessor :images
diff --git a/lib/mailosaur.rb b/lib/mailosaur.rb
index eb74c85..91dc5f9 100644
--- a/lib/mailosaur.rb
+++ b/lib/mailosaur.rb
@@ -34,6 +34,7 @@ module Models
autoload :MessageContent, 'Mailosaur/models/message_content.rb'
autoload :Server, 'Mailosaur/models/server.rb'
autoload :Link, 'Mailosaur/models/link.rb'
+ autoload :Code, 'Mailosaur/models/code.rb'
autoload :ServerListResult, 'Mailosaur/models/server_list_result.rb'
autoload :SpamFilterResults, 'Mailosaur/models/spam_filter_results.rb'
autoload :ServerCreateOptions, 'Mailosaur/models/server_create_options.rb'
diff --git a/test/emails_test.rb b/test/emails_test.rb
index 0ae9903..1fb363e 100644
--- a/test/emails_test.rb
+++ b/test/emails_test.rb
@@ -386,6 +386,11 @@ def validate_html(email)
assert_equal('http://invalid/', email.html.links[2].href)
assert_equal('invalid', email.html.links[2].text)
+ # Html.Links
+ assert_equal(2, email.html.codes.length)
+ assert_equal('123456', email.html.codes[0].value)
+ assert_equal('G3H1Y2', email.html.codes[1].value)
+
# Html.Images
assert_true(email.html.images[1].src.start_with?('cid:'))
assert_equal('Inline image 1', email.html.images[1].alt)
@@ -401,6 +406,11 @@ def validate_text(email)
assert_equal(email.text.links[0].href, email.text.links[0].text)
assert_equal('https://mailosaur.com/', email.text.links[1].href)
assert_equal(email.text.links[1].href, email.text.links[1].text)
+
+ # Text.Links
+ assert_equal(2, email.text.codes.length)
+ assert_equal('654321', email.text.codes[0].value)
+ assert_equal('5H0Y2', email.text.codes[1].value)
end
def validate_headers(email)
diff --git a/test/mailer.rb b/test/mailer.rb
index 285c90f..704e762 100644
--- a/test/mailer.rb
+++ b/test/mailer.rb
@@ -1,5 +1,4 @@
require 'mail'
-require 'securerandom'
Mail.defaults do
delivery_method :smtp, {
@@ -22,7 +21,7 @@ def self.send_emails(client, server, quantity)
def self.send_email(client, server, send_to_address = nil)
Mail.deliver do
- random_string = SecureRandom.hex(5)
+ random_string = (0...10).map { rand(65..90).chr }.join
subject '%s subject' % [random_string]
random_to_address = send_to_address || client.servers.generate_email_address(server)
diff --git a/test/resources/testEmail.html b/test/resources/testEmail.html
index abce10b..60379d7 100644
--- a/test/resources/testEmail.html
+++ b/test/resources/testEmail.html
@@ -17,6 +17,14 @@
+
+ Your verification code is 123456
+
+
+
+ Your special ID is G3H1Y2
+
+
@@ -25,4 +33,4 @@
-
\ No newline at end of file
+
diff --git a/test/resources/testEmail.txt b/test/resources/testEmail.txt
index 773df2e..b3de48a 100644
--- a/test/resources/testEmail.txt
+++ b/test/resources/testEmail.txt
@@ -6,4 +6,8 @@ REPLACED_DURING_TEST text
this is an image:[image: Inline image 1]
-this is an invalid link: invalid
\ No newline at end of file
+Your verification code is 654321
+
+Your special ID is 5H0Y2
+
+this is an invalid link: invalid