Skip to content

Commit

Permalink
assorted fixes 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantk committed Oct 19, 2023
1 parent c1eef4b commit 39dc2a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/microsoft_graph/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ def create_and_send_new_reply(mailbox:, draft:)
private

def add_content_and_send_message(draft, user_id:, message_id:, details:)
update_message(user_id:, message_id:, details:)
update_message(user_id:, message_id:, details:)

draft.attachments.each do |file_attachment|
add_file_attachment_to_message(user_id:, file_attachment:, message_id:)
add_file_attachment_to_message(user_id:, file_attachment:, message_id:)
end

send_message(user_id:, message_id:)
get_message(user_id:, message_id:)
send_message(user_id:, message_id:)
get_message(user_id:, message_id:)
end

def details_for_new_message(draft, mailbox)
Expand Down
3 changes: 2 additions & 1 deletion spec/factories/emails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
outlook_read_at { "2021-12-15 11:51:12" }
is_read { false }
template { nil }
association :case, factory: :support_case

association :ticket, factory: :support_case

trait :inbox do
folder { :inbox }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe "Agent can add attachments to replies", :with_csrf_protection, js: true do
include_context "with an agent"

let(:email) { create(:support_email, :inbox, case: support_case) }
let(:email) { create(:support_email, :inbox, ticket: support_case) }
let(:support_case) { create(:support_case) }

before do
Expand Down
2 changes: 1 addition & 1 deletion spec/models/support/case/email_ticketable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
context "when email already has a ticket assigned (just sent as a draft message)" do
it "remains attached to that ticket" do
support_case = create(:support_case, :initial)
email = create(:support_email, ticket: support_case)
email = create(:email, ticket: support_case)

Support::Case.on_email_cached(email)

Expand Down

0 comments on commit 39dc2a7

Please sign in to comment.