-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #479 from slovensko-digital/GO-83/index_template_m…
…essage_drafts_content GO-83 Save templates MessageDraft content to HTML visualization in order to be searchable
- Loading branch information
Showing
10 changed files
with
98 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ draft_two: | |
message_object: ssd_main_general_draft_two_form | ||
blob: <GeneralAgenda xmlns="http://schemas.gov.sk/form/App.GeneralAgenda/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><subject>predmet</subject><text>text</text></GeneralAgenda> | ||
|
||
empty_draft: | ||
message_object: ssd_main_empty_draft_form | ||
blob: <GeneralAgenda xmlns="http://schemas.gov.sk/form/App.GeneralAgenda/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><subject></subject><text></text></GeneralAgenda> | ||
|
||
fs_one: | ||
message_object: ssd_main_fs_one_form | ||
blob: <n0:ElectronicOfficialDocument xmlns:n0="http://schemas.gov.sk/form/42499500.FS_EUD_v1_0.sk/1.6"> <n0:Sender> <n0:PersonData> <n0:CorporateBody> <n0:FinancialAdministrationAuthority>Daňový úrad Bratislava</n0:FinancialAdministrationAuthority> </n0:CorporateBody> <n0:PhysicalAddress> <n0:AddressLine>Ševčenkova 32, 850 00 Bratislava</n0:AddressLine> </n0:PhysicalAddress> </n0:PersonData> </n0:Sender> <n0:Document> <n0:DocumentReference>000000000/2022</n0:DocumentReference> <n0:ContactPerson>Mgr. X Y</n0:ContactPerson> <n0:PhoneNumber>02/00000000</n0:PhoneNumber> <n0:EmailAddress>[email protected]</n0:EmailAddress> <n0:IssuePlace>Bratislava</n0:IssuePlace> <n0:IssueDate>2022-04-19</n0:IssueDate> <n0:Subject>Rozhodnutie</n0:Subject> </n0:Document></n0:ElectronicOfficialDocument> |
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
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
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 |
---|---|---|
@@ -1,6 +1,59 @@ | ||
require "application_system_test_case" | ||
|
||
class MessageDraftsTest < ApplicationSystemTestCase | ||
setup do | ||
Searchable::MessageThread.reindex_all | ||
|
||
silence_warnings do | ||
@old_value = MessageThreadCollection.const_get("PER_PAGE") | ||
MessageThreadCollection.const_set("PER_PAGE", 1) | ||
end | ||
|
||
sign_in_as(:basic) | ||
end | ||
|
||
teardown do | ||
silence_warnings do | ||
MessageThreadCollection.const_set("PER_PAGE", @old_value) | ||
end | ||
end | ||
|
||
test "user can create message draft as reply on replyable message" do | ||
end | ||
|
||
test "templated message draft content is searchable" do | ||
message = messages(:ssd_main_empty_draft) | ||
thread = message_threads(:ssd_main_empty_draft) | ||
|
||
visit message_thread_path thread | ||
|
||
within "#body_upvs_message_draft_#{message.id}_form" do | ||
fill_in "message_draft_Text", with: "Pozdrav zo Slovensko.Digital! :)" | ||
fill_in "message_draft_Predmet", with: "Pozdravovacia sprava" | ||
end | ||
|
||
assert_text "Zmeny boli uložené" | ||
|
||
GoodJob.perform_inline | ||
|
||
# Search the draft content keywords | ||
visit message_threads_path | ||
|
||
assert_no_selector "#next_page_area" | ||
|
||
fill_in "search", with: "Slovensko.Digital" | ||
find("#search").send_keys(:enter) | ||
|
||
assert_no_selector "#next_page_area" | ||
|
||
thread_general = message_threads(:ssd_main_general) | ||
thread_issue = message_threads(:ssd_main_issue) | ||
|
||
within_thread_in_listing(thread) do | ||
assert_text "Slovensko.Digital" | ||
end | ||
|
||
refute_selector(thread_in_listing_selector(thread_general)) | ||
refute_selector(thread_in_listing_selector(thread_issue)) | ||
end | ||
end |