-
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 #241 from solver-it-sro/add-tests
Add some tests
- Loading branch information
Showing
36 changed files
with
477 additions
and
41 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
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,5 +1,5 @@ | ||
<%= tag.turbo_frame id: "tag-form-visible-#{@tag.id}" do %> | ||
<%= form_with model: @tag, url: admin_tenant_tag_path(Current.tenant, @tag), method: :patch do |form| %> | ||
<%= form_with model: @tag, url: admin_tenant_tag_path(Current.tenant, @tag), title: "Zmeniť viditeľnosť štítku", method: :patch do |form| %> | ||
<%= form.hidden_field :visible, value: [email protected] %> | ||
<%= form.button class: "#{@tag.visible ? "bg-indigo-600" : "bg-gray-200"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2", role: :switch, aria: { checked: @tag.visible.to_s } do %> | ||
<span class="sr-only">Use setting</span> | ||
|
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
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,14 +1,24 @@ | ||
one_one: | ||
automation_rule: one | ||
type: Automation::AddMessageThreadTagAction | ||
action_object: ssd_external_visible (Tag) | ||
|
||
one: | ||
automation_rule: two | ||
type: Automation::AddMessageThreadTagAction | ||
action_object: ssd_construction (Tag) | ||
|
||
two: | ||
automation_rule: three | ||
automation_rule: two | ||
type: Automation::AddMessageThreadTagAction | ||
action_object: ssd_office (Tag) | ||
|
||
three: | ||
automation_rule: four | ||
automation_rule: three | ||
type: Automation::AddMessageThreadTagAction | ||
action_object: ssd_print (Tag) | ||
|
||
four: | ||
automation_rule: four | ||
type: Automation::AddMessageThreadTagAction | ||
action_object: ssd_external_visible (Tag) |
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 |
---|---|---|
|
@@ -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 |
---|---|---|
|
@@ -5,6 +5,11 @@ basic: | |
email: [email protected] | ||
tenant: ssd | ||
|
||
basic_two: | ||
name: Another user | ||
email: [email protected] | ||
tenant: ssd | ||
|
||
admin: | ||
name: Admin user | ||
email: [email protected] | ||
|
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require "application_system_test_case" | ||
|
||
class AuditLogTest < ApplicationSystemTestCase | ||
setup do | ||
sign_in_as(:admin) | ||
end | ||
|
||
test "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 "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 |
Oops, something went wrong.