-
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.
- Loading branch information
Showing
11 changed files
with
159 additions
and
3 deletions.
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 |
---|---|---|
|
@@ -7,3 +7,7 @@ ssd_basic_basic_user: | |
ssd_basic_all: | ||
user: basic | ||
group: ssd_all | ||
|
||
ssd_admin_admin: | ||
user: admin | ||
group: ssd_admins |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
ssd: | ||
name: SSD | ||
feature_flags: ['audit_log'] | ||
|
||
solver: | ||
name: Solver | ||
|
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require "application_system_test_case" | ||
|
||
class AuditLogTest < ApplicationSystemTestCase | ||
setup do | ||
Searchable::MessageThread.reindex_all | ||
|
||
sign_in_as(:admin) | ||
end | ||
|
||
test "an admin can access thread audit logs" do | ||
visit message_thread_path(message_threads(:ssd_main_general)) | ||
|
||
click_button "message-thread-options" | ||
click_link "Auditné záznamy" | ||
|
||
assert_text "Auditné záznamy pre vlákno" | ||
|
||
click_link "Export CSV" | ||
end | ||
|
||
test "an admin can access user audit logs" do | ||
visit root_path | ||
|
||
click_link "Nastavenia" | ||
|
||
click_link "Používatelia" | ||
|
||
within("#user_#{users(:admin).id}") do | ||
click_link "Auditné záznamy používateľa" | ||
end | ||
|
||
assert_text "Auditné záznamy pre používateľa" | ||
|
||
click_link "Export CSV" | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "application_system_test_case" | ||
|
||
class MessageThreadsBulkMergeTest < ApplicationSystemTestCase | ||
setup do | ||
Searchable::MessageThread.reindex_all | ||
sign_in_as(:basic) | ||
end | ||
|
||
test "a user merge multiple threads" do | ||
visit message_threads_path | ||
|
||
thread_issue = message_threads(:ssd_main_issue) | ||
thread_general = message_threads(:ssd_main_general) | ||
|
||
check "message_thread_#{thread_issue.id}" | ||
check "message_thread_#{thread_general.id}" | ||
|
||
assert_text "2 označené správy" | ||
|
||
click_button "Hromadné akcie" | ||
|
||
accept_alert do | ||
click_button "Spojiť vlákna" | ||
end | ||
|
||
assert_text "Vlákna boli úspešne spojené" | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require "application_system_test_case" | ||
|
||
class MessageThreadsHistoryTest < ApplicationSystemTestCase | ||
setup do | ||
@thread_general = message_threads(:ssd_main_general) | ||
|
||
sign_in_as(:basic) | ||
end | ||
|
||
test "a user visit thread history" do | ||
visit message_thread_path(@thread_general) | ||
|
||
click_button "message-thread-options" | ||
click_link "História komunikácie" | ||
|
||
assert_text "História komunikácie" | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require "application_system_test_case" | ||
|
||
class MessageThreadsNoteTest < ApplicationSystemTestCase | ||
setup do | ||
sign_in_as(:admin) | ||
end | ||
|
||
test "a user can add a thread note" do | ||
visit message_thread_path(message_threads(:ssd_main_delivery)) | ||
|
||
click_button "message-thread-options" | ||
|
||
click_link "Pridať poznámku" | ||
|
||
fill_in "message_thread_note_note", with: "A note" | ||
|
||
click_button "Uložiť" | ||
|
||
assert_text "A note" | ||
end | ||
|
||
test "a user can update a thread note" do | ||
visit message_thread_path(message_threads(:ssd_main_general)) | ||
|
||
click_button "message-thread-options" | ||
|
||
click_link "Upraviť poznámku" | ||
|
||
fill_in "message_thread_note_note", with: "Updated note" | ||
|
||
click_button "Uložiť" | ||
|
||
assert_text "Updated note" | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require "application_system_test_case" | ||
|
||
class MessageThreadsRenameTest < ApplicationSystemTestCase | ||
setup do | ||
@thread_general = message_threads(:ssd_main_general) | ||
|
||
sign_in_as(:basic) | ||
end | ||
|
||
test "a user can rename thread" do | ||
visit message_thread_path(@thread_general) | ||
|
||
click_button "message-thread-options" | ||
click_link "Premenovať" | ||
|
||
fill_in "message_thread_title", with: "New name" | ||
|
||
click_button "Zmeniť názov" | ||
|
||
assert_text "New name" | ||
end | ||
end |