generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FactoryBot.define do | ||
factory :email_attachment, class: "EmailAttachment" do | ||
file { Rack::Test::UploadedFile.new(Rails.root.join("spec/support/assets/support/email_attachments/attachment.txt"), "text/plain") } | ||
|
||
association :email, factory: :support_email | ||
|
||
trait :without_file do | ||
file { nil } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FactoryBot.define do | ||
factory :email, class: "Email" do | ||
subject { "Support Case #001" } | ||
|
||
body { "<html><head></head><body><h1>My support request</h1><p>Please update my case</p></body></html>" } | ||
sender { { address: "[email protected]", name: "Sender 1" } } | ||
recipients { [{ address: "[email protected]", name: "Recipient 1" }] } | ||
to_recipients { [{ address: "[email protected]", name: "To Recipient" }] } | ||
cc_recipients { [{ address: "[email protected]", name: "CC Recipient" }] } | ||
bcc_recipients { [{ address: "[email protected]", name: "BCC Recipient" }] } | ||
outlook_conversation_id { "MyString" } | ||
case_id { "" } | ||
sent_at { "2021-12-15 11:51:12" } | ||
outlook_received_at { "2021-12-15 11:51:12" } | ||
outlook_read_at { "2021-12-15 11:51:12" } | ||
is_read { false } | ||
template { nil } | ||
association :case, factory: :support_case | ||
|
||
trait :inbox do | ||
folder { :inbox } | ||
end | ||
|
||
trait :sent_items do | ||
folder { :sent_items } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,4 @@ | ||
FactoryBot.define do | ||
factory :support_email, class: "Support::Email" do | ||
subject { "Support Case #001" } | ||
|
||
body { "<html><head></head><body><h1>My support request</h1><p>Please update my case</p></body></html>" } | ||
sender { { address: "[email protected]", name: "Sender 1" } } | ||
recipients { [{ address: "[email protected]", name: "Recipient 1" }] } | ||
to_recipients { [{ address: "[email protected]", name: "To Recipient" }] } | ||
cc_recipients { [{ address: "[email protected]", name: "CC Recipient" }] } | ||
bcc_recipients { [{ address: "[email protected]", name: "BCC Recipient" }] } | ||
outlook_conversation_id { "MyString" } | ||
case_id { "" } | ||
sent_at { "2021-12-15 11:51:12" } | ||
outlook_received_at { "2021-12-15 11:51:12" } | ||
outlook_read_at { "2021-12-15 11:51:12" } | ||
is_read { false } | ||
template { nil } | ||
association :case, factory: :support_case | ||
|
||
trait :inbox do | ||
folder { :inbox } | ||
end | ||
|
||
trait :sent_items do | ||
folder { :sent_items } | ||
end | ||
factory :support_email, parent: :email do | ||
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 |
---|---|---|
@@ -1,11 +1,4 @@ | ||
FactoryBot.define do | ||
factory :support_email_attachment, class: "Support::EmailAttachment" do | ||
file { Rack::Test::UploadedFile.new(Rails.root.join("spec/support/assets/support/email_attachments/attachment.txt"), "text/plain") } | ||
|
||
association :email, factory: :support_email | ||
|
||
trait :without_file do | ||
file { nil } | ||
end | ||
factory :support_email_attachment, parent: :email_attachment do | ||
end | ||
end |