diff --git a/config/application.rb b/config/application.rb index 7b59d86f1..3c80246b8 100644 --- a/config/application.rb +++ b/config/application.rb @@ -38,7 +38,6 @@ module Zammad 'observer::_ticket::_ref_object_touch', 'observer::_ticket::_online_notification_seen', 'observer::_ticket::_stats_reopen', - 'observer::_ticket::_escalation_update', 'observer::_tag::_ticket_history', 'observer::_user::_ref_object_touch', 'observer::_user::_ticket_organization', diff --git a/test/controllers/api_auth_controller_test.rb b/test/controllers/api_auth_controller_test.rb index a6d9b5835..c60162269 100644 --- a/test/controllers/api_auth_controller_test.rb +++ b/test/controllers/api_auth_controller_test.rb @@ -12,7 +12,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'api-admin', firstname: 'API', lastname: 'Admin', @@ -25,7 +25,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'api-agent@example.com', firstname: 'API', lastname: 'Agent', @@ -38,7 +38,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer = User.create_or_update( + @customer = User.create!( login: 'api-customer1@example.com', firstname: 'API', lastname: 'Customer1', diff --git a/test/controllers/api_auth_on_behalf_of_controller_test.rb b/test/controllers/api_auth_on_behalf_of_controller_test.rb index 61c1e119d..492aaed27 100644 --- a/test/controllers/api_auth_on_behalf_of_controller_test.rb +++ b/test/controllers/api_auth_on_behalf_of_controller_test.rb @@ -12,7 +12,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'api-admin-auth-behalf', firstname: 'API', lastname: 'Admin', @@ -25,7 +25,7 @@ class ApiAuthControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer = User.create_or_update( + @customer = User.create!( login: 'api-customer1-auth-behalf@example.com', firstname: 'API', lastname: 'Customer1', diff --git a/test/controllers/calendar_controller_test.rb b/test/controllers/calendar_controller_test.rb index 68731739d..927b952cd 100644 --- a/test/controllers/calendar_controller_test.rb +++ b/test/controllers/calendar_controller_test.rb @@ -12,7 +12,7 @@ class CalendarControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'calendar-admin', firstname: 'Packages', lastname: 'Admin', diff --git a/test/controllers/organization_controller_test.rb b/test/controllers/organization_controller_test.rb index d5972d28a..994331559 100644 --- a/test/controllers/organization_controller_test.rb +++ b/test/controllers/organization_controller_test.rb @@ -14,7 +14,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'rest-admin', firstname: 'Rest', lastname: 'Agent', @@ -27,7 +27,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'rest-agent@example.com', firstname: 'Rest', lastname: 'Agent', @@ -40,7 +40,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'rest-customer1@example.com', firstname: 'Rest', lastname: 'Customer1', @@ -51,18 +51,18 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest ) # create orgs - @organization = Organization.create_or_update( + @organization = Organization.create!( name: 'Rest Org', ) - @organization2 = Organization.create_or_update( + @organization2 = Organization.create!( name: 'Rest Org #2', ) - @organization3 = Organization.create_or_update( + @organization3 = Organization.create!( name: 'Rest Org #3', ) # create customer with org - @customer_with_org = User.create_or_update( + @customer_with_org = User.create!( login: 'rest-customer2@example.com', firstname: 'Rest', lastname: 'Customer2', @@ -229,7 +229,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest end test '04.01 organization show and response format' do - organization = Organization.create_or_update( + organization = Organization.create!( name: 'Rest Org NEW', members: [@customer_without_org], updated_by_id: @admin.id, @@ -297,7 +297,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest end test '04.02 organization index and response format' do - organization = Organization.create_or_update( + organization = Organization.create!( name: 'Rest Org NEW', members: [@customer_without_org], updated_by_id: @admin.id, @@ -420,7 +420,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest end test '04.04 ticket update and response formats' do - organization = Organization.create_or_update( + organization = Organization.create!( name: 'Rest Org NEW', members: [@customer_without_org], updated_by_id: @admin.id, @@ -510,7 +510,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest test '05.03 csv import - admin access' do UserInfo.current_user_id = 1 - customer1 = User.create_or_update( + customer1 = User.create!( login: 'customer1-members@example.com', firstname: 'Member', lastname: 'Customer', @@ -518,7 +518,7 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest password: 'customerpw', active: true, ) - customer2 = User.create_or_update( + customer2 = User.create!( login: 'customer2-members@example.com', firstname: 'Member', lastname: 'Customer', diff --git a/test/controllers/overviews_controller_test.rb b/test/controllers/overviews_controller_test.rb index 1ee47955b..d2bcb36c0 100644 --- a/test/controllers/overviews_controller_test.rb +++ b/test/controllers/overviews_controller_test.rb @@ -12,7 +12,7 @@ class OverviewsControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'tickets-admin', firstname: 'Tickets', lastname: 'Admin', @@ -25,7 +25,7 @@ class OverviewsControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'tickets-agent@example.com', firstname: 'Tickets', lastname: 'Agent', diff --git a/test/controllers/packages_controller_test.rb b/test/controllers/packages_controller_test.rb index 1eac66ca5..25f254d92 100644 --- a/test/controllers/packages_controller_test.rb +++ b/test/controllers/packages_controller_test.rb @@ -12,7 +12,7 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'packages-admin', firstname: 'Packages', lastname: 'Admin', @@ -25,7 +25,7 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'packages-agent@example.com', firstname: 'Rest', lastname: 'Agent', @@ -38,7 +38,7 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'packages-customer1@example.com', firstname: 'Packages', lastname: 'Customer1', diff --git a/test/controllers/reports_controller_test.rb b/test/controllers/reports_controller_test.rb index 2967c628c..df24fb9d4 100644 --- a/test/controllers/reports_controller_test.rb +++ b/test/controllers/reports_controller_test.rb @@ -18,7 +18,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'rest-admin', firstname: 'Rest', lastname: 'Agent', @@ -32,7 +32,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest ) roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'rest-customer1@example.com', firstname: 'Rest', lastname: 'Customer1', @@ -44,7 +44,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest created_by_id: 1 ) - @group1 = Group.create_or_update( + @group1 = Group.create!( name: "GroupWithoutPermission-#{rand(9_999_999_999)}", active: true, updated_by_id: 1, diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb index 6bfa3f726..18d69425d 100644 --- a/test/controllers/search_controller_test.rb +++ b/test/controllers/search_controller_test.rb @@ -15,7 +15,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest roles = Role.where(name: %w[Admin Agent]) groups = Group.all - @admin = User.create_or_update( + @admin = User.create!( login: 'search-admin', firstname: 'Search', lastname: 'Admin', @@ -28,7 +28,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'search-agent@example.com', firstname: 'Search 1234', lastname: 'Agent', @@ -41,7 +41,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'search-customer1@example.com', firstname: 'Search', lastname: 'Customer1', @@ -52,18 +52,18 @@ class SearchControllerTest < ActionDispatch::IntegrationTest ) # create orgs - @organization = Organization.create_or_update( + @organization = Organization.create!( name: 'Rest Org', ) - @organization2 = Organization.create_or_update( + @organization2 = Organization.create!( name: 'Rest Org #2', ) - @organization3 = Organization.create_or_update( + @organization3 = Organization.create!( name: 'Rest Org #3', ) # create customer with org - @customer_with_org2 = User.create_or_update( + @customer_with_org2 = User.create!( login: 'search-customer2@example.com', firstname: 'Search', lastname: 'Customer2', @@ -74,7 +74,7 @@ class SearchControllerTest < ActionDispatch::IntegrationTest organization_id: @organization.id, ) - @customer_with_org3 = User.create_or_update( + @customer_with_org3 = User.create!( login: 'search-customer3@example.com', firstname: 'Search', lastname: 'Customer3', diff --git a/test/controllers/settings_controller_test.rb b/test/controllers/settings_controller_test.rb index 5930ba0f5..bf8a570f4 100644 --- a/test/controllers/settings_controller_test.rb +++ b/test/controllers/settings_controller_test.rb @@ -12,7 +12,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin_full = User.create_or_update( + @admin_full = User.create!( login: 'setting-admin', firstname: 'Setting', lastname: 'Admin', @@ -23,7 +23,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest groups: groups, ) - role_api = Role.create_or_update( + role_api = Role.create!( name: 'AdminApi', note: 'To configure your api.', preferences: { @@ -34,7 +34,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest created_by_id: 1 ) role_api.permission_grant('admin.api') - @admin_api = User.create_or_update( + @admin_api = User.create!( login: 'setting-admin-api', firstname: 'Setting', lastname: 'Admin Api', @@ -47,7 +47,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'setting-agent@example.com', firstname: 'Setting', lastname: 'Agent', @@ -60,7 +60,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'setting-customer1@example.com', firstname: 'Setting', lastname: 'Customer1', diff --git a/test/controllers/sla_controller_test.rb b/test/controllers/sla_controller_test.rb index b5d28ea31..e8b8a932b 100644 --- a/test/controllers/sla_controller_test.rb +++ b/test/controllers/sla_controller_test.rb @@ -12,7 +12,7 @@ class SlaControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'sla-admin', firstname: 'Packages', lastname: 'Admin', diff --git a/test/controllers/taskbars_controller_test.rb b/test/controllers/taskbars_controller_test.rb index e8a8bf48b..b37c52ff5 100644 --- a/test/controllers/taskbars_controller_test.rb +++ b/test/controllers/taskbars_controller_test.rb @@ -12,7 +12,7 @@ class TaskbarsControllerTest < ActionDispatch::IntegrationTest roles = Role.where(name: 'Agent') groups = Group.all - @agent = User.create_or_update( + @agent = User.create!( login: 'taskbar-agent@example.com', firstname: 'Taskbar', lastname: 'Agent', @@ -25,7 +25,7 @@ class TaskbarsControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'taskbar-customer1@example.com', firstname: 'Taskbar', lastname: 'Customer1', diff --git a/test/controllers/text_module_controller_test.rb b/test/controllers/text_module_controller_test.rb index 92d1a27e8..4dc6ab2b3 100644 --- a/test/controllers/text_module_controller_test.rb +++ b/test/controllers/text_module_controller_test.rb @@ -14,7 +14,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'rest-admin', firstname: 'Rest', lastname: 'Agent', @@ -27,7 +27,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'rest-agent@example.com', firstname: 'Rest', lastname: 'Agent', @@ -40,7 +40,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'rest-customer1@example.com', firstname: 'Rest', lastname: 'Customer1', @@ -51,7 +51,7 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest ) # create customer - @customer_with_org = User.create_or_update( + @customer_with_org = User.create!( login: 'rest-customer2@example.com', firstname: 'Rest', lastname: 'Customer2', diff --git a/test/controllers/ticket_article_attachments_controller_test.rb b/test/controllers/ticket_article_attachments_controller_test.rb index 750728eb6..2b55969b0 100644 --- a/test/controllers/ticket_article_attachments_controller_test.rb +++ b/test/controllers/ticket_article_attachments_controller_test.rb @@ -9,7 +9,7 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'tickets-admin', firstname: 'Tickets', lastname: 'Admin', @@ -22,7 +22,7 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'tickets-agent@example.com', firstname: 'Tickets', lastname: 'Agent', @@ -35,7 +35,7 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'tickets-customer1@example.com', firstname: 'Tickets', lastname: 'Customer1', diff --git a/test/controllers/ticket_articles_controller_test.rb b/test/controllers/ticket_articles_controller_test.rb index 840f154e8..73b355032 100644 --- a/test/controllers/ticket_articles_controller_test.rb +++ b/test/controllers/ticket_articles_controller_test.rb @@ -12,7 +12,7 @@ class TicketArticlesControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'tickets-admin', firstname: 'Tickets', lastname: 'Admin', @@ -25,7 +25,7 @@ class TicketArticlesControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'tickets-agent@example.com', firstname: 'Tickets', lastname: 'Agent', @@ -38,7 +38,7 @@ class TicketArticlesControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'tickets-customer1@example.com', firstname: 'Tickets', lastname: 'Customer1', diff --git a/test/controllers/tickets_controller_test.rb b/test/controllers/tickets_controller_test.rb index 01f1b9a45..14937569d 100644 --- a/test/controllers/tickets_controller_test.rb +++ b/test/controllers/tickets_controller_test.rb @@ -12,7 +12,7 @@ class TicketsControllerTest < ActionDispatch::IntegrationTest groups = Group.all UserInfo.current_user_id = 1 - @admin = User.create_or_update( + @admin = User.create!( login: 'tickets-admin', firstname: 'Tickets', lastname: 'Admin', @@ -25,7 +25,7 @@ class TicketsControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'tickets-agent@example.com', firstname: 'Tickets', lastname: 'Agent', @@ -38,7 +38,7 @@ class TicketsControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'tickets-customer1@example.com', firstname: 'Tickets', lastname: 'Customer1', @@ -719,7 +719,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO end test '02.03 ticket with wrong ticket id' do - group = Group.create_or_update( + group = Group.create!( name: "GroupWithoutPermission-#{rand(9_999_999_999)}", active: true, updated_by_id: 1, @@ -1952,7 +1952,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO end 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)}", active: true, updated_by_id: 1, @@ -2024,7 +2024,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO end test '07.01 ticket merge' do - group_no_permission = Group.create_or_update( + group_no_permission = Group.create!( name: 'GroupWithNoPermission', active: true, updated_by_id: 1, @@ -2089,7 +2089,7 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO end test '07.02 ticket merge - change permission' do - group_change_permission = Group.create_or_update( + group_change_permission = Group.create!( name: 'GroupWithChangePermission', active: true, updated_by_id: 1, diff --git a/test/controllers/time_accounting_controller_test.rb b/test/controllers/time_accounting_controller_test.rb index bb1add059..dd386340c 100644 --- a/test/controllers/time_accounting_controller_test.rb +++ b/test/controllers/time_accounting_controller_test.rb @@ -15,7 +15,7 @@ class TimeAccountingControllerTest < ActionDispatch::IntegrationTest @year = DateTime.now.utc.year @month = DateTime.now.utc.month - @admin = User.create_or_update( + @admin = User.create!( login: 'rest-admin', firstname: 'Rest', lastname: 'Agent', @@ -29,7 +29,7 @@ class TimeAccountingControllerTest < ActionDispatch::IntegrationTest ) roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'rest-customer1@example.com', firstname: 'Rest', lastname: 'Customer1', @@ -43,7 +43,7 @@ class TimeAccountingControllerTest < ActionDispatch::IntegrationTest end test '01.01 time account report' do - group = Group.create_or_update( + group = Group.create!( name: "GroupWithoutPermission-#{rand(9_999_999_999)}", active: true, updated_by_id: 1, diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb index 133ea84ed..d5edb0afe 100644 --- a/test/controllers/user_controller_test.rb +++ b/test/controllers/user_controller_test.rb @@ -14,7 +14,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest UserInfo.current_user_id = 1 - @backup_admin = User.create_or_update( + @backup_admin = User.create!( login: 'backup-admin', firstname: 'Backup', lastname: 'Agent', @@ -25,7 +25,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest groups: groups, ) - @admin = User.create_or_update( + @admin = User.create!( login: 'rest-admin', firstname: 'Rest', lastname: 'Agent', @@ -38,7 +38,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'rest-agent@example.com', firstname: 'Rest', lastname: 'Agent', @@ -51,7 +51,7 @@ class UserControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'rest-customer1@example.com', firstname: 'Rest', lastname: 'Customer1', @@ -62,18 +62,18 @@ class UserControllerTest < ActionDispatch::IntegrationTest ) # create orgs - @organization = Organization.create_or_update( + @organization = Organization.create!( name: 'Rest Org', ) - @organization2 = Organization.create_or_update( + @organization2 = Organization.create!( name: 'Rest Org #2', ) - @organization3 = Organization.create_or_update( + @organization3 = Organization.create!( name: 'Rest Org #3', ) # create customer with org - @customer_with_org = User.create_or_update( + @customer_with_org = User.create!( login: 'rest-customer2@example.com', firstname: 'Rest', lastname: 'Customer2', diff --git a/test/controllers/user_organization_controller_test.rb b/test/controllers/user_organization_controller_test.rb index e2910a56a..60c936776 100644 --- a/test/controllers/user_organization_controller_test.rb +++ b/test/controllers/user_organization_controller_test.rb @@ -14,7 +14,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest UserInfo.current_user_id = 1 - @backup_admin = User.create_or_update( + @backup_admin = User.create!( login: 'backup-admin', firstname: 'Backup', lastname: 'Agent', @@ -25,7 +25,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest groups: groups, ) - @admin = User.create_or_update( + @admin = User.create!( login: 'rest-admin', firstname: 'Rest', lastname: 'Agent', @@ -38,7 +38,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest # create agent roles = Role.where(name: 'Agent') - @agent = User.create_or_update( + @agent = User.create!( login: 'rest-agent@example.com', firstname: 'Rest', lastname: 'Agent', @@ -51,7 +51,7 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest # create customer without org roles = Role.where(name: 'Customer') - @customer_without_org = User.create_or_update( + @customer_without_org = User.create!( login: 'rest-customer1@example.com', firstname: 'Rest', lastname: 'Customer1', @@ -62,18 +62,18 @@ class UserOrganizationControllerTest < ActionDispatch::IntegrationTest ) # create orgs - @organization = Organization.create_or_update( + @organization = Organization.create!( name: 'Rest Org', ) - @organization2 = Organization.create_or_update( + @organization2 = Organization.create!( name: 'Rest Org #2', ) - @organization3 = Organization.create_or_update( + @organization3 = Organization.create!( name: 'Rest Org #3', ) # create customer with org - @customer_with_org = User.create_or_update( + @customer_with_org = User.create!( login: 'rest-customer2@example.com', firstname: 'Rest', lastname: 'Customer2',