Skip to content

Commit

Permalink
Add reply system test
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-rl committed Dec 6, 2023
1 parent 0bf1a45 commit 4ccb981
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ Style/Lambda:
Enabled: false
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/ExplicitBlockArgument:
Enabled: false
Rails/Validation:
Enabled: false
6 changes: 6 additions & 0 deletions test/helpers/page_parts_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ def within_tags
yield
end
end

def within_message_in_thread(message)
within("\##{dom_id(message)}") do
yield
end
end
end
24 changes: 24 additions & 0 deletions test/system/message_threads_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,28 @@ class MessageThreadsTest < ApplicationSystemTestCase
end
end
end

test "a user can go to a thread detail and reply to message" do
visit message_threads_path

thread_issue = message_threads(:ssd_main_issue)
message_one = messages(:ssd_main_issue_one)
job_count_previous = GoodJob::Job.count

within_thread_in_listing(thread_issue) do
click_link
end

within_message_in_thread(message_one) do
find_button("Odpovedať").click
end

within '#new_drafts' do
find_field("Predmet").fill_in(with: "Testovaci predmet")
find_field("Text").fill_in(with: "Testovacie telo")
find_button("Odoslať").click
end

assert GoodJob::Job.count, job_count_previous + 1
end
end

0 comments on commit 4ccb981

Please sign in to comment.