Small code cleanup.
This commit is contained in:
parent
24a30ad26c
commit
f80fbf4744
19 changed files with 78 additions and 79 deletions
|
@ -38,7 +38,6 @@ module Zammad
|
||||||
'observer::_ticket::_ref_object_touch',
|
'observer::_ticket::_ref_object_touch',
|
||||||
'observer::_ticket::_online_notification_seen',
|
'observer::_ticket::_online_notification_seen',
|
||||||
'observer::_ticket::_stats_reopen',
|
'observer::_ticket::_stats_reopen',
|
||||||
'observer::_ticket::_escalation_update',
|
|
||||||
'observer::_tag::_ticket_history',
|
'observer::_tag::_ticket_history',
|
||||||
'observer::_user::_ref_object_touch',
|
'observer::_user::_ref_object_touch',
|
||||||
'observer::_user::_ticket_organization',
|
'observer::_user::_ticket_organization',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'api-admin',
|
login: 'api-admin',
|
||||||
firstname: 'API',
|
firstname: 'API',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -25,7 +25,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'api-agent@example.com',
|
login: 'api-agent@example.com',
|
||||||
firstname: 'API',
|
firstname: 'API',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -38,7 +38,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer = User.create_or_update(
|
@customer = User.create!(
|
||||||
login: 'api-customer1@example.com',
|
login: 'api-customer1@example.com',
|
||||||
firstname: 'API',
|
firstname: 'API',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'api-admin-auth-behalf',
|
login: 'api-admin-auth-behalf',
|
||||||
firstname: 'API',
|
firstname: 'API',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -25,7 +25,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer = User.create_or_update(
|
@customer = User.create!(
|
||||||
login: 'api-customer1-auth-behalf@example.com',
|
login: 'api-customer1-auth-behalf@example.com',
|
||||||
firstname: 'API',
|
firstname: 'API',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class CalendarControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'calendar-admin',
|
login: 'calendar-admin',
|
||||||
firstname: 'Packages',
|
firstname: 'Packages',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
|
|
@ -14,7 +14,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'rest-admin',
|
login: 'rest-admin',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -27,7 +27,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'rest-agent@example.com',
|
login: 'rest-agent@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -40,7 +40,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'rest-customer1@example.com',
|
login: 'rest-customer1@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -51,18 +51,18 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# create orgs
|
# create orgs
|
||||||
@organization = Organization.create_or_update(
|
@organization = Organization.create!(
|
||||||
name: 'Rest Org',
|
name: 'Rest Org',
|
||||||
)
|
)
|
||||||
@organization2 = Organization.create_or_update(
|
@organization2 = Organization.create!(
|
||||||
name: 'Rest Org #2',
|
name: 'Rest Org #2',
|
||||||
)
|
)
|
||||||
@organization3 = Organization.create_or_update(
|
@organization3 = Organization.create!(
|
||||||
name: 'Rest Org #3',
|
name: 'Rest Org #3',
|
||||||
)
|
)
|
||||||
|
|
||||||
# create customer with org
|
# create customer with org
|
||||||
@customer_with_org = User.create_or_update(
|
@customer_with_org = User.create!(
|
||||||
login: 'rest-customer2@example.com',
|
login: 'rest-customer2@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer2',
|
lastname: 'Customer2',
|
||||||
|
@ -229,7 +229,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test '04.01 organization show and response format' do
|
test '04.01 organization show and response format' do
|
||||||
organization = Organization.create_or_update(
|
organization = Organization.create!(
|
||||||
name: 'Rest Org NEW',
|
name: 'Rest Org NEW',
|
||||||
members: [@customer_without_org],
|
members: [@customer_without_org],
|
||||||
updated_by_id: @admin.id,
|
updated_by_id: @admin.id,
|
||||||
|
@ -297,7 +297,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test '04.02 organization index and response format' do
|
test '04.02 organization index and response format' do
|
||||||
organization = Organization.create_or_update(
|
organization = Organization.create!(
|
||||||
name: 'Rest Org NEW',
|
name: 'Rest Org NEW',
|
||||||
members: [@customer_without_org],
|
members: [@customer_without_org],
|
||||||
updated_by_id: @admin.id,
|
updated_by_id: @admin.id,
|
||||||
|
@ -420,7 +420,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test '04.04 ticket update and response formats' do
|
test '04.04 ticket update and response formats' do
|
||||||
organization = Organization.create_or_update(
|
organization = Organization.create!(
|
||||||
name: 'Rest Org NEW',
|
name: 'Rest Org NEW',
|
||||||
members: [@customer_without_org],
|
members: [@customer_without_org],
|
||||||
updated_by_id: @admin.id,
|
updated_by_id: @admin.id,
|
||||||
|
@ -510,7 +510,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
test '05.03 csv import - admin access' do
|
test '05.03 csv import - admin access' do
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
customer1 = User.create_or_update(
|
customer1 = User.create!(
|
||||||
login: 'customer1-members@example.com',
|
login: 'customer1-members@example.com',
|
||||||
firstname: 'Member',
|
firstname: 'Member',
|
||||||
lastname: 'Customer',
|
lastname: 'Customer',
|
||||||
|
@ -518,7 +518,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
password: 'customerpw',
|
password: 'customerpw',
|
||||||
active: true,
|
active: true,
|
||||||
)
|
)
|
||||||
customer2 = User.create_or_update(
|
customer2 = User.create!(
|
||||||
login: 'customer2-members@example.com',
|
login: 'customer2-members@example.com',
|
||||||
firstname: 'Member',
|
firstname: 'Member',
|
||||||
lastname: 'Customer',
|
lastname: 'Customer',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class OverviewsControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'tickets-admin',
|
login: 'tickets-admin',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -25,7 +25,7 @@ class OverviewsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'tickets-agent@example.com',
|
login: 'tickets-agent@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'packages-admin',
|
login: 'packages-admin',
|
||||||
firstname: 'Packages',
|
firstname: 'Packages',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -25,7 +25,7 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'packages-agent@example.com',
|
login: 'packages-agent@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -38,7 +38,7 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'packages-customer1@example.com',
|
login: 'packages-customer1@example.com',
|
||||||
firstname: 'Packages',
|
firstname: 'Packages',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'rest-admin',
|
login: 'rest-admin',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -32,7 +32,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'rest-customer1@example.com',
|
login: 'rest-customer1@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -44,7 +44,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||||
created_by_id: 1
|
created_by_id: 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@group1 = Group.create_or_update(
|
@group1 = Group.create!(
|
||||||
name: "GroupWithoutPermission-#{rand(9_999_999_999)}",
|
name: "GroupWithoutPermission-#{rand(9_999_999_999)}",
|
||||||
active: true,
|
active: true,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
|
|
|
@ -15,7 +15,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
roles = Role.where(name: %w[Admin Agent])
|
roles = Role.where(name: %w[Admin Agent])
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'search-admin',
|
login: 'search-admin',
|
||||||
firstname: 'Search',
|
firstname: 'Search',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -28,7 +28,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'search-agent@example.com',
|
login: 'search-agent@example.com',
|
||||||
firstname: 'Search 1234',
|
firstname: 'Search 1234',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -41,7 +41,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'search-customer1@example.com',
|
login: 'search-customer1@example.com',
|
||||||
firstname: 'Search',
|
firstname: 'Search',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -52,18 +52,18 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# create orgs
|
# create orgs
|
||||||
@organization = Organization.create_or_update(
|
@organization = Organization.create!(
|
||||||
name: 'Rest Org',
|
name: 'Rest Org',
|
||||||
)
|
)
|
||||||
@organization2 = Organization.create_or_update(
|
@organization2 = Organization.create!(
|
||||||
name: 'Rest Org #2',
|
name: 'Rest Org #2',
|
||||||
)
|
)
|
||||||
@organization3 = Organization.create_or_update(
|
@organization3 = Organization.create!(
|
||||||
name: 'Rest Org #3',
|
name: 'Rest Org #3',
|
||||||
)
|
)
|
||||||
|
|
||||||
# create customer with org
|
# create customer with org
|
||||||
@customer_with_org2 = User.create_or_update(
|
@customer_with_org2 = User.create!(
|
||||||
login: 'search-customer2@example.com',
|
login: 'search-customer2@example.com',
|
||||||
firstname: 'Search',
|
firstname: 'Search',
|
||||||
lastname: 'Customer2',
|
lastname: 'Customer2',
|
||||||
|
@ -74,7 +74,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
organization_id: @organization.id,
|
organization_id: @organization.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
@customer_with_org3 = User.create_or_update(
|
@customer_with_org3 = User.create!(
|
||||||
login: 'search-customer3@example.com',
|
login: 'search-customer3@example.com',
|
||||||
firstname: 'Search',
|
firstname: 'Search',
|
||||||
lastname: 'Customer3',
|
lastname: 'Customer3',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin_full = User.create_or_update(
|
@admin_full = User.create!(
|
||||||
login: 'setting-admin',
|
login: 'setting-admin',
|
||||||
firstname: 'Setting',
|
firstname: 'Setting',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -23,7 +23,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups: groups,
|
groups: groups,
|
||||||
)
|
)
|
||||||
|
|
||||||
role_api = Role.create_or_update(
|
role_api = Role.create!(
|
||||||
name: 'AdminApi',
|
name: 'AdminApi',
|
||||||
note: 'To configure your api.',
|
note: 'To configure your api.',
|
||||||
preferences: {
|
preferences: {
|
||||||
|
@ -34,7 +34,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
|
||||||
created_by_id: 1
|
created_by_id: 1
|
||||||
)
|
)
|
||||||
role_api.permission_grant('admin.api')
|
role_api.permission_grant('admin.api')
|
||||||
@admin_api = User.create_or_update(
|
@admin_api = User.create!(
|
||||||
login: 'setting-admin-api',
|
login: 'setting-admin-api',
|
||||||
firstname: 'Setting',
|
firstname: 'Setting',
|
||||||
lastname: 'Admin Api',
|
lastname: 'Admin Api',
|
||||||
|
@ -47,7 +47,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'setting-agent@example.com',
|
login: 'setting-agent@example.com',
|
||||||
firstname: 'Setting',
|
firstname: 'Setting',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -60,7 +60,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'setting-customer1@example.com',
|
login: 'setting-customer1@example.com',
|
||||||
firstname: 'Setting',
|
firstname: 'Setting',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class SlaControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'sla-admin',
|
login: 'sla-admin',
|
||||||
firstname: 'Packages',
|
firstname: 'Packages',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class TaskbarsControllerTest < ActionDispatch::IntegrationTest
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'taskbar-agent@example.com',
|
login: 'taskbar-agent@example.com',
|
||||||
firstname: 'Taskbar',
|
firstname: 'Taskbar',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -25,7 +25,7 @@ class TaskbarsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'taskbar-customer1@example.com',
|
login: 'taskbar-customer1@example.com',
|
||||||
firstname: 'Taskbar',
|
firstname: 'Taskbar',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -14,7 +14,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'rest-admin',
|
login: 'rest-admin',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -27,7 +27,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'rest-agent@example.com',
|
login: 'rest-agent@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -40,7 +40,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'rest-customer1@example.com',
|
login: 'rest-customer1@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -51,7 +51,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# create customer
|
# create customer
|
||||||
@customer_with_org = User.create_or_update(
|
@customer_with_org = User.create!(
|
||||||
login: 'rest-customer2@example.com',
|
login: 'rest-customer2@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer2',
|
lastname: 'Customer2',
|
||||||
|
|
|
@ -9,7 +9,7 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'tickets-admin',
|
login: 'tickets-admin',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -22,7 +22,7 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'tickets-agent@example.com',
|
login: 'tickets-agent@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -35,7 +35,7 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'tickets-customer1@example.com',
|
login: 'tickets-customer1@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class TicketArticlesControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'tickets-admin',
|
login: 'tickets-admin',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -25,7 +25,7 @@ class TicketArticlesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'tickets-agent@example.com',
|
login: 'tickets-agent@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -38,7 +38,7 @@ class TicketArticlesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'tickets-customer1@example.com',
|
login: 'tickets-customer1@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
|
|
@ -12,7 +12,7 @@ class TicketsControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'tickets-admin',
|
login: 'tickets-admin',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Admin',
|
lastname: 'Admin',
|
||||||
|
@ -25,7 +25,7 @@ class TicketsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'tickets-agent@example.com',
|
login: 'tickets-agent@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -38,7 +38,7 @@ class TicketsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'tickets-customer1@example.com',
|
login: 'tickets-customer1@example.com',
|
||||||
firstname: 'Tickets',
|
firstname: 'Tickets',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -719,7 +719,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
|
||||||
end
|
end
|
||||||
|
|
||||||
test '02.03 ticket with wrong ticket id' do
|
test '02.03 ticket with wrong ticket id' do
|
||||||
group = Group.create_or_update(
|
group = Group.create!(
|
||||||
name: "GroupWithoutPermission-#{rand(9_999_999_999)}",
|
name: "GroupWithoutPermission-#{rand(9_999_999_999)}",
|
||||||
active: true,
|
active: true,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
|
@ -1952,7 +1952,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
|
||||||
end
|
end
|
||||||
|
|
||||||
test '06.01 - ticket with follow up possible set to new_ticket' do
|
test '06.01 - ticket with follow up possible set to new_ticket' do
|
||||||
group = Group.create_or_update(
|
group = Group.create!(
|
||||||
name: "GroupWithNoFollowUp-#{rand(9_999_999_999)}",
|
name: "GroupWithNoFollowUp-#{rand(9_999_999_999)}",
|
||||||
active: true,
|
active: true,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
|
@ -2024,7 +2024,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
|
||||||
end
|
end
|
||||||
|
|
||||||
test '07.01 ticket merge' do
|
test '07.01 ticket merge' do
|
||||||
group_no_permission = Group.create_or_update(
|
group_no_permission = Group.create!(
|
||||||
name: 'GroupWithNoPermission',
|
name: 'GroupWithNoPermission',
|
||||||
active: true,
|
active: true,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
|
@ -2089,7 +2089,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
|
||||||
end
|
end
|
||||||
|
|
||||||
test '07.02 ticket merge - change permission' do
|
test '07.02 ticket merge - change permission' do
|
||||||
group_change_permission = Group.create_or_update(
|
group_change_permission = Group.create!(
|
||||||
name: 'GroupWithChangePermission',
|
name: 'GroupWithChangePermission',
|
||||||
active: true,
|
active: true,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
|
|
|
@ -15,7 +15,7 @@ class TimeAccountingControllerTest < ActionDispatch::IntegrationTest
|
||||||
@year = DateTime.now.utc.year
|
@year = DateTime.now.utc.year
|
||||||
@month = DateTime.now.utc.month
|
@month = DateTime.now.utc.month
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'rest-admin',
|
login: 'rest-admin',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -29,7 +29,7 @@ class TimeAccountingControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'rest-customer1@example.com',
|
login: 'rest-customer1@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -43,7 +43,7 @@ class TimeAccountingControllerTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test '01.01 time account report' do
|
test '01.01 time account report' do
|
||||||
group = Group.create_or_update(
|
group = Group.create!(
|
||||||
name: "GroupWithoutPermission-#{rand(9_999_999_999)}",
|
name: "GroupWithoutPermission-#{rand(9_999_999_999)}",
|
||||||
active: true,
|
active: true,
|
||||||
updated_by_id: 1,
|
updated_by_id: 1,
|
||||||
|
|
|
@ -14,7 +14,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
@backup_admin = User.create_or_update(
|
@backup_admin = User.create!(
|
||||||
login: 'backup-admin',
|
login: 'backup-admin',
|
||||||
firstname: 'Backup',
|
firstname: 'Backup',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -25,7 +25,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups: groups,
|
groups: groups,
|
||||||
)
|
)
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'rest-admin',
|
login: 'rest-admin',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -38,7 +38,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'rest-agent@example.com',
|
login: 'rest-agent@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -51,7 +51,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'rest-customer1@example.com',
|
login: 'rest-customer1@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -62,18 +62,18 @@ class UserControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# create orgs
|
# create orgs
|
||||||
@organization = Organization.create_or_update(
|
@organization = Organization.create!(
|
||||||
name: 'Rest Org',
|
name: 'Rest Org',
|
||||||
)
|
)
|
||||||
@organization2 = Organization.create_or_update(
|
@organization2 = Organization.create!(
|
||||||
name: 'Rest Org #2',
|
name: 'Rest Org #2',
|
||||||
)
|
)
|
||||||
@organization3 = Organization.create_or_update(
|
@organization3 = Organization.create!(
|
||||||
name: 'Rest Org #3',
|
name: 'Rest Org #3',
|
||||||
)
|
)
|
||||||
|
|
||||||
# create customer with org
|
# create customer with org
|
||||||
@customer_with_org = User.create_or_update(
|
@customer_with_org = User.create!(
|
||||||
login: 'rest-customer2@example.com',
|
login: 'rest-customer2@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer2',
|
lastname: 'Customer2',
|
||||||
|
|
|
@ -14,7 +14,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
@backup_admin = User.create_or_update(
|
@backup_admin = User.create!(
|
||||||
login: 'backup-admin',
|
login: 'backup-admin',
|
||||||
firstname: 'Backup',
|
firstname: 'Backup',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -25,7 +25,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
groups: groups,
|
groups: groups,
|
||||||
)
|
)
|
||||||
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create!(
|
||||||
login: 'rest-admin',
|
login: 'rest-admin',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -38,7 +38,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create agent
|
# create agent
|
||||||
roles = Role.where(name: 'Agent')
|
roles = Role.where(name: 'Agent')
|
||||||
@agent = User.create_or_update(
|
@agent = User.create!(
|
||||||
login: 'rest-agent@example.com',
|
login: 'rest-agent@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Agent',
|
lastname: 'Agent',
|
||||||
|
@ -51,7 +51,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
# create customer without org
|
# create customer without org
|
||||||
roles = Role.where(name: 'Customer')
|
roles = Role.where(name: 'Customer')
|
||||||
@customer_without_org = User.create_or_update(
|
@customer_without_org = User.create!(
|
||||||
login: 'rest-customer1@example.com',
|
login: 'rest-customer1@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer1',
|
lastname: 'Customer1',
|
||||||
|
@ -62,18 +62,18 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest
|
||||||
)
|
)
|
||||||
|
|
||||||
# create orgs
|
# create orgs
|
||||||
@organization = Organization.create_or_update(
|
@organization = Organization.create!(
|
||||||
name: 'Rest Org',
|
name: 'Rest Org',
|
||||||
)
|
)
|
||||||
@organization2 = Organization.create_or_update(
|
@organization2 = Organization.create!(
|
||||||
name: 'Rest Org #2',
|
name: 'Rest Org #2',
|
||||||
)
|
)
|
||||||
@organization3 = Organization.create_or_update(
|
@organization3 = Organization.create!(
|
||||||
name: 'Rest Org #3',
|
name: 'Rest Org #3',
|
||||||
)
|
)
|
||||||
|
|
||||||
# create customer with org
|
# create customer with org
|
||||||
@customer_with_org = User.create_or_update(
|
@customer_with_org = User.create!(
|
||||||
login: 'rest-customer2@example.com',
|
login: 'rest-customer2@example.com',
|
||||||
firstname: 'Rest',
|
firstname: 'Rest',
|
||||||
lastname: 'Customer2',
|
lastname: 'Customer2',
|
||||||
|
|
Loading…
Reference in a new issue