diff --git a/spec/features/support/case_attachments/agent_can_rename_attachments_on_case_spec.rb b/spec/features/support/case_attachments/agent_can_rename_attachments_on_case_spec.rb index 552044cde..676685b2f 100644 --- a/spec/features/support/case_attachments/agent_can_rename_attachments_on_case_spec.rb +++ b/spec/features/support/case_attachments/agent_can_rename_attachments_on_case_spec.rb @@ -7,7 +7,7 @@ let(:file) { fixture_file_upload(Rails.root.join("spec/fixtures/support/text-file.txt"), "text/plain") } before do - create(:support_email_attachment, file:, email: create(:support_email, :inbox, case: support_case)) + create(:support_email_attachment, file:, email: create(:support_email, :inbox, ticket: support_case)) end it "adds a custom name and description to the attachment", js: true do diff --git a/spec/features/support/emails/agent_can_download_attachments_spec.rb b/spec/features/support/emails/agent_can_download_attachments_spec.rb index 8f2b3f562..4764951a0 100644 --- a/spec/features/support/emails/agent_can_download_attachments_spec.rb +++ b/spec/features/support/emails/agent_can_download_attachments_spec.rb @@ -1,7 +1,7 @@ describe "Agent can download attachments", js: true do include_context "with an agent" - let(:email) { create(:support_email, :inbox, case: support_case, unique_body: "Catering requirements") } + let(:email) { create(:support_email, :inbox, ticket: support_case, unique_body: "Catering requirements") } let(:support_case) { create(:support_case) } before do diff --git a/spec/features/support/emails/agent_can_mark_email_as_read_spec.rb b/spec/features/support/emails/agent_can_mark_email_as_read_spec.rb index 28dab35f3..750ac26b2 100644 --- a/spec/features/support/emails/agent_can_mark_email_as_read_spec.rb +++ b/spec/features/support/emails/agent_can_mark_email_as_read_spec.rb @@ -4,7 +4,7 @@ include_context "with an agent" let(:is_read) { true } - let(:email) { create(:support_email, :inbox, case: support_case, subject: "Catering requirements", is_read:) } + let(:email) { create(:support_email, :inbox, ticket: support_case, subject: "Catering requirements", is_read:) } let(:support_case) { create(:support_case) } before do diff --git a/spec/features/support/emails/agent_sees_email_threads_spec.rb b/spec/features/support/emails/agent_sees_email_threads_spec.rb index 38845abd9..8470fddae 100644 --- a/spec/features/support/emails/agent_sees_email_threads_spec.rb +++ b/spec/features/support/emails/agent_sees_email_threads_spec.rb @@ -7,8 +7,8 @@ context "when messages accross multiple threads exist" do before do - create(:support_email, :inbox, case: support_case, outlook_conversation_id: "OCID1", subject: "Email thread 1", recipients: [{ "name" => "Test 1", "address" => "test1@email.com" }], unique_body: "Email 1", is_read: false) - create(:support_email, :inbox, case: support_case, outlook_conversation_id: "OCID2", subject: "Email thread 2", recipients: [{ "name" => "Test 2", "address" => "test2@email.com" }], unique_body: "Email 2", is_read: true) + create(:support_email, :inbox, ticket: support_case, outlook_conversation_id: "OCID1", subject: "Email thread 1", recipients: [{ "name" => "Test 1", "address" => "test1@email.com" }], unique_body: "Email 1", is_read: false) + create(:support_email, :inbox, ticket: support_case, outlook_conversation_id: "OCID2", subject: "Email thread 2", recipients: [{ "name" => "Test 2", "address" => "test2@email.com" }], unique_body: "Email 2", is_read: true) create(:support_email, ticket: support_case, outlook_conversation_id: "OCID2", subject: "Re: Email thread 2", unique_body: "Email 3") visit support_case_path(support_case) diff --git a/spec/requests/support/email_read_status_spec.rb b/spec/requests/support/email_read_status_spec.rb index 327672919..167ddf111 100644 --- a/spec/requests/support/email_read_status_spec.rb +++ b/spec/requests/support/email_read_status_spec.rb @@ -16,7 +16,7 @@ let(:support_case) { create(:support_case, :action_required) } context "when there are other unread emails in the inbox" do - before { create(:support_email, :inbox, case: support_case, is_read: false) } + before { create(:support_email, :inbox, ticket: support_case, is_read: false) } specify "then the case remains as action required" do patch support_email_read_status_path(email, status: "read") @@ -25,7 +25,7 @@ end context "when there are other unread emails in the sent items folder" do - before { create(:support_email, :sent_items, case: support_case, is_read: false) } + before { create(:support_email, :sent_items, ticket: support_case, is_read: false) } specify "then the case is not longer marked as action required" do patch support_email_read_status_path(email, status: "read") @@ -35,8 +35,8 @@ context "when there are no unread emails in the inbox but there are unread sent items" do before do - create(:support_email, :inbox, case: support_case, is_read: true) - create(:support_email, :sent_items, case: support_case, is_read: false) + create(:support_email, :inbox, ticket: support_case, is_read: true) + create(:support_email, :sent_items, ticket: support_case, is_read: false) end specify "then the case is not longer marked as action required" do @@ -60,7 +60,7 @@ let(:support_case) { create(:support_case, action_required: true) } context "when there are other unread emails in the inbox" do - before { create(:support_email, :inbox, case: support_case, is_read: false) } + before { create(:support_email, :inbox, ticket: support_case, is_read: false) } specify "then the case remains as action required" do patch support_email_read_status_path(email, status: "read") @@ -69,7 +69,7 @@ end context "when there are other unread emails in the sent items folder" do - before { create(:support_email, :sent_items, case: support_case, is_read: false) } + before { create(:support_email, :sent_items, ticket: support_case, is_read: false) } specify "then the case is not longer marked as action required" do patch support_email_read_status_path(email, status: "read") @@ -79,8 +79,8 @@ context "when there are no unread emails in the inbox but there are unread sent items" do before do - create(:support_email, :inbox, case: support_case, is_read: true) - create(:support_email, :sent_items, case: support_case, is_read: false) + create(:support_email, :inbox, ticket: support_case, is_read: true) + create(:support_email, :sent_items, ticket: support_case, is_read: false) end specify "then the case is not longer marked as action required" do diff --git a/spec/support/shared/duplicate_email_attachments.rb b/spec/support/shared/duplicate_email_attachments.rb index 718ffa67a..0e73e4913 100644 --- a/spec/support/shared/duplicate_email_attachments.rb +++ b/spec/support/shared/duplicate_email_attachments.rb @@ -7,11 +7,11 @@ # same file name, different checksum let(:file_3) { fixture_file_upload(Rails.root.join("spec/fixtures/text-file.txt"), "text/plain") } - let!(:case_1_attachment_1) { create(:support_email_attachment, file: file_1, email: create(:support_email, :inbox, case: case_1)) } - let!(:case_1_attachment_2) { create(:support_email_attachment, file: file_2, email: create(:support_email, :inbox, case: case_1)) } - let!(:case_1_attachment_3) { create(:support_email_attachment, file: file_2, email: create(:support_email, :inbox, case: case_1)) } - let!(:case_1_attachment_4) { create(:support_email_attachment, file: file_3, email: create(:support_email, :inbox, case: case_1)) } - let!(:case_2_attachment_1) { create(:support_email_attachment, file: file_1, email: create(:support_email, :inbox, case: case_2)) } - let!(:case_2_attachment_2) { create(:support_email_attachment, file: file_1, email: create(:support_email, :inbox, case: case_2)) } - let!(:case_2_attachment_3) { create(:support_email_attachment, file: file_2, email: create(:support_email, :inbox, case: case_2)) } + let!(:case_1_attachment_1) { create(:support_email_attachment, file: file_1, email: create(:support_email, :inbox, ticket: case_1)) } + let!(:case_1_attachment_2) { create(:support_email_attachment, file: file_2, email: create(:support_email, :inbox, ticket: case_1)) } + let!(:case_1_attachment_3) { create(:support_email_attachment, file: file_2, email: create(:support_email, :inbox, ticket: case_1)) } + let!(:case_1_attachment_4) { create(:support_email_attachment, file: file_3, email: create(:support_email, :inbox, ticket: case_1)) } + let!(:case_2_attachment_1) { create(:support_email_attachment, file: file_1, email: create(:support_email, :inbox, ticket: case_2)) } + let!(:case_2_attachment_2) { create(:support_email_attachment, file: file_1, email: create(:support_email, :inbox, ticket: case_2)) } + let!(:case_2_attachment_3) { create(:support_email_attachment, file: file_2, email: create(:support_email, :inbox, ticket: case_2)) } end