Skip to content

Commit

Permalink
Add simple reply create test
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-rl committed Dec 5, 2023
1 parent f41b028 commit e9e9aa0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/models/message_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,20 @@ class MessageTest < ActiveSupport::TestCase
assert_not message.tags.include?(tag)
assert message.thread.tags.include?(tag)
end

test "reply to message should create a signable draft" do
message = messages(:ssd_main_general_one)
user = users(:basic)

reply = MessageDraft.create_message_reply(original_message: message, author: user)

assert_equal reply.sender_name, message.recipient_name
assert_equal reply.recipient_name, message.sender_name
assert_equal reply.message_thread_id, message.message_thread_id
assert_match message.title, reply.title
assert_match "Odpoveď", reply.title
assert_equal reply.type, "MessageDraft"
assert_equal reply.author_id, user.id
assert_not reply.collapsed
end
end

0 comments on commit e9e9aa0

Please sign in to comment.