diff --git a/.rubocop/todo.yml b/.rubocop/todo.yml index 47a2aef41..ed43c7705 100644 --- a/.rubocop/todo.yml +++ b/.rubocop/todo.yml @@ -138,18 +138,6 @@ Metrics/AbcSize: - 'app/models/concerns/has_rich_text.rb' - 'app/models/concerns/has_search_index_backend.rb' - 'app/models/concerns/has_search_sortable.rb' - - 'app/models/concerns/ticket/article/adds_metadata_email.rb' - - 'app/models/concerns/ticket/article/adds_metadata_general.rb' - - 'app/models/concerns/ticket/article/adds_metadata_origin_by_id.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_email_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_facebook_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_sms_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_telegram_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_twitter_job.rb' - - 'app/models/concerns/ticket/article/resets_ticket_state.rb' - - 'app/models/concerns/ticket/sets_last_owner_update_time.rb' - - 'app/models/concerns/ticket/touches_associations.rb' - - 'app/models/concerns/user/performs_geo_lookup.rb' - 'app/models/cti/caller_id.rb' - 'app/models/cti/driver/base.rb' - 'app/models/cti/driver/placetel.rb' @@ -196,8 +184,17 @@ Metrics/AbcSize: - 'app/models/text_module.rb' - 'app/models/ticket.rb' - 'app/models/ticket/article.rb' + - 'app/models/ticket/article/adds_metadata_email.rb' + - 'app/models/ticket/article/adds_metadata_general.rb' + - 'app/models/ticket/article/adds_metadata_origin_by_id.rb' - 'app/models/ticket/article/assets.rb' + - 'app/models/ticket/article/enqueue_communicate_email_job.rb' + - 'app/models/ticket/article/enqueue_communicate_facebook_job.rb' + - 'app/models/ticket/article/enqueue_communicate_sms_job.rb' + - 'app/models/ticket/article/enqueue_communicate_telegram_job.rb' + - 'app/models/ticket/article/enqueue_communicate_twitter_job.rb' - 'app/models/ticket/article/has_ticket_contact_attributes_impact.rb' + - 'app/models/ticket/article/resets_ticket_state.rb' - 'app/models/ticket/assets.rb' - 'app/models/ticket/escalation.rb' - 'app/models/ticket/number/date.rb' @@ -207,8 +204,10 @@ Metrics/AbcSize: - 'app/models/ticket/screen_options.rb' - 'app/models/ticket/search.rb' - 'app/models/ticket/search_index.rb' + - 'app/models/ticket/sets_last_owner_update_time.rb' - 'app/models/ticket/state.rb' - 'app/models/ticket/subject.rb' + - 'app/models/ticket/touches_associations.rb' - 'app/models/token.rb' - 'app/models/transaction.rb' - 'app/models/transaction/clearbit_enrichment.rb' @@ -221,6 +220,7 @@ Metrics/AbcSize: - 'app/models/trigger/assets.rb' - 'app/models/user.rb' - 'app/models/user/assets.rb' + - 'app/models/user/performs_geo_lookup.rb' - 'app/models/user/search.rb' - 'app/models/user/search_index.rb' - 'app/models/user_device.rb' @@ -533,17 +533,6 @@ Metrics/CyclomaticComplexity: - 'app/models/concerns/has_rich_text.rb' - 'app/models/concerns/has_search_index_backend.rb' - 'app/models/concerns/has_search_sortable.rb' - - 'app/models/concerns/ticket/article/adds_metadata_email.rb' - - 'app/models/concerns/ticket/article/adds_metadata_general.rb' - - 'app/models/concerns/ticket/article/adds_metadata_origin_by_id.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_email_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_facebook_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_sms_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_twitter_job.rb' - - 'app/models/concerns/ticket/article/resets_ticket_state.rb' - - 'app/models/concerns/ticket/sets_last_owner_update_time.rb' - - 'app/models/concerns/ticket/touches_associations.rb' - - 'app/models/concerns/user/performs_geo_lookup.rb' - 'app/models/cti/caller_id.rb' - 'app/models/cti/driver/base.rb' - 'app/models/cti/driver/placetel.rb' @@ -572,8 +561,16 @@ Metrics/CyclomaticComplexity: - 'app/models/store.rb' - 'app/models/taskbar.rb' - 'app/models/ticket/article.rb' + - 'app/models/ticket/article/adds_metadata_email.rb' + - 'app/models/ticket/article/adds_metadata_general.rb' + - 'app/models/ticket/article/adds_metadata_origin_by_id.rb' - 'app/models/ticket/article/assets.rb' + - 'app/models/ticket/article/enqueue_communicate_email_job.rb' + - 'app/models/ticket/article/enqueue_communicate_facebook_job.rb' + - 'app/models/ticket/article/enqueue_communicate_sms_job.rb' + - 'app/models/ticket/article/enqueue_communicate_twitter_job.rb' - 'app/models/ticket/article/has_ticket_contact_attributes_impact.rb' + - 'app/models/ticket/article/resets_ticket_state.rb' - 'app/models/ticket/assets.rb' - 'app/models/ticket/escalation.rb' - 'app/models/ticket/number/date.rb' @@ -581,7 +578,9 @@ Metrics/CyclomaticComplexity: - 'app/models/ticket/screen_options.rb' - 'app/models/ticket/search.rb' - 'app/models/ticket/search_index.rb' + - 'app/models/ticket/sets_last_owner_update_time.rb' - 'app/models/ticket/state.rb' + - 'app/models/ticket/touches_associations.rb' - 'app/models/token.rb' - 'app/models/transaction/clearbit_enrichment.rb' - 'app/models/transaction/karma.rb' @@ -592,6 +591,7 @@ Metrics/CyclomaticComplexity: - 'app/models/trigger/assets.rb' - 'app/models/user.rb' - 'app/models/user/assets.rb' + - 'app/models/user/performs_geo_lookup.rb' - 'app/models/user/search.rb' - 'app/models/user/search_index.rb' - 'app/models/user_device.rb' @@ -763,16 +763,6 @@ Metrics/PerceivedComplexity: - 'app/models/concerns/has_rich_text.rb' - 'app/models/concerns/has_search_index_backend.rb' - 'app/models/concerns/has_search_sortable.rb' - - 'app/models/concerns/ticket/article/adds_metadata_email.rb' - - 'app/models/concerns/ticket/article/adds_metadata_general.rb' - - 'app/models/concerns/ticket/article/adds_metadata_origin_by_id.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_email_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_facebook_job.rb' - - 'app/models/concerns/ticket/article/enqueue_communicate_twitter_job.rb' - - 'app/models/concerns/ticket/article/resets_ticket_state.rb' - - 'app/models/concerns/ticket/sets_last_owner_update_time.rb' - - 'app/models/concerns/ticket/touches_associations.rb' - - 'app/models/concerns/user/performs_geo_lookup.rb' - 'app/models/cti/caller_id.rb' - 'app/models/cti/driver/base.rb' - 'app/models/cti/driver/placetel.rb' @@ -801,14 +791,23 @@ Metrics/PerceivedComplexity: - 'app/models/taskbar.rb' - 'app/models/ticket.rb' - 'app/models/ticket/article.rb' + - 'app/models/ticket/article/adds_metadata_email.rb' + - 'app/models/ticket/article/adds_metadata_general.rb' + - 'app/models/ticket/article/adds_metadata_origin_by_id.rb' - 'app/models/ticket/article/assets.rb' + - 'app/models/ticket/article/enqueue_communicate_email_job.rb' + - 'app/models/ticket/article/enqueue_communicate_facebook_job.rb' + - 'app/models/ticket/article/enqueue_communicate_twitter_job.rb' - 'app/models/ticket/article/has_ticket_contact_attributes_impact.rb' + - 'app/models/ticket/article/resets_ticket_state.rb' - 'app/models/ticket/escalation.rb' - 'app/models/ticket/number/date.rb' - 'app/models/ticket/overviews.rb' - 'app/models/ticket/screen_options.rb' - 'app/models/ticket/search.rb' - 'app/models/ticket/search_index.rb' + - 'app/models/ticket/sets_last_owner_update_time.rb' + - 'app/models/ticket/touches_associations.rb' - 'app/models/token.rb' - 'app/models/transaction/clearbit_enrichment.rb' - 'app/models/transaction/karma.rb' @@ -819,6 +818,7 @@ Metrics/PerceivedComplexity: - 'app/models/trigger/assets.rb' - 'app/models/user.rb' - 'app/models/user/assets.rb' + - 'app/models/user/performs_geo_lookup.rb' - 'app/models/user/search.rb' - 'app/models/user/search_index.rb' - 'app/models/user_device.rb' diff --git a/app/models/concerns/tag/writes_to_ticket_history.rb b/app/models/tag/writes_to_ticket_history.rb similarity index 100% rename from app/models/concerns/tag/writes_to_ticket_history.rb rename to app/models/tag/writes_to_ticket_history.rb diff --git a/app/models/concerns/ticket/article/adds_metadata_email.rb b/app/models/ticket/article/adds_metadata_email.rb similarity index 100% rename from app/models/concerns/ticket/article/adds_metadata_email.rb rename to app/models/ticket/article/adds_metadata_email.rb diff --git a/app/models/concerns/ticket/article/adds_metadata_general.rb b/app/models/ticket/article/adds_metadata_general.rb similarity index 100% rename from app/models/concerns/ticket/article/adds_metadata_general.rb rename to app/models/ticket/article/adds_metadata_general.rb diff --git a/app/models/concerns/ticket/article/adds_metadata_origin_by_id.rb b/app/models/ticket/article/adds_metadata_origin_by_id.rb similarity index 100% rename from app/models/concerns/ticket/article/adds_metadata_origin_by_id.rb rename to app/models/ticket/article/adds_metadata_origin_by_id.rb diff --git a/app/models/concerns/ticket/article/enqueue_communicate_email_job.rb b/app/models/ticket/article/enqueue_communicate_email_job.rb similarity index 100% rename from app/models/concerns/ticket/article/enqueue_communicate_email_job.rb rename to app/models/ticket/article/enqueue_communicate_email_job.rb diff --git a/app/models/concerns/ticket/article/enqueue_communicate_facebook_job.rb b/app/models/ticket/article/enqueue_communicate_facebook_job.rb similarity index 100% rename from app/models/concerns/ticket/article/enqueue_communicate_facebook_job.rb rename to app/models/ticket/article/enqueue_communicate_facebook_job.rb diff --git a/app/models/concerns/ticket/article/enqueue_communicate_sms_job.rb b/app/models/ticket/article/enqueue_communicate_sms_job.rb similarity index 100% rename from app/models/concerns/ticket/article/enqueue_communicate_sms_job.rb rename to app/models/ticket/article/enqueue_communicate_sms_job.rb diff --git a/app/models/concerns/ticket/article/enqueue_communicate_telegram_job.rb b/app/models/ticket/article/enqueue_communicate_telegram_job.rb similarity index 100% rename from app/models/concerns/ticket/article/enqueue_communicate_telegram_job.rb rename to app/models/ticket/article/enqueue_communicate_telegram_job.rb diff --git a/app/models/concerns/ticket/article/enqueue_communicate_twitter_job.rb b/app/models/ticket/article/enqueue_communicate_twitter_job.rb similarity index 100% rename from app/models/concerns/ticket/article/enqueue_communicate_twitter_job.rb rename to app/models/ticket/article/enqueue_communicate_twitter_job.rb diff --git a/app/models/concerns/ticket/article/resets_ticket_state.rb b/app/models/ticket/article/resets_ticket_state.rb similarity index 100% rename from app/models/concerns/ticket/article/resets_ticket_state.rb rename to app/models/ticket/article/resets_ticket_state.rb diff --git a/app/models/concerns/ticket/calls_stats_ticket_reopen_log.rb b/app/models/ticket/calls_stats_ticket_reopen_log.rb similarity index 100% rename from app/models/concerns/ticket/calls_stats_ticket_reopen_log.rb rename to app/models/ticket/calls_stats_ticket_reopen_log.rb diff --git a/app/models/concerns/ticket/enqueues_user_ticket_counter_job.rb b/app/models/ticket/enqueues_user_ticket_counter_job.rb similarity index 100% rename from app/models/concerns/ticket/enqueues_user_ticket_counter_job.rb rename to app/models/ticket/enqueues_user_ticket_counter_job.rb diff --git a/app/models/concerns/ticket/resets_pending_time_seconds.rb b/app/models/ticket/resets_pending_time_seconds.rb similarity index 100% rename from app/models/concerns/ticket/resets_pending_time_seconds.rb rename to app/models/ticket/resets_pending_time_seconds.rb diff --git a/app/models/concerns/ticket/sets_close_time.rb b/app/models/ticket/sets_close_time.rb similarity index 100% rename from app/models/concerns/ticket/sets_close_time.rb rename to app/models/ticket/sets_close_time.rb diff --git a/app/models/concerns/ticket/sets_last_owner_update_time.rb b/app/models/ticket/sets_last_owner_update_time.rb similarity index 100% rename from app/models/concerns/ticket/sets_last_owner_update_time.rb rename to app/models/ticket/sets_last_owner_update_time.rb diff --git a/app/models/concerns/ticket/sets_online_notification_seen.rb b/app/models/ticket/sets_online_notification_seen.rb similarity index 100% rename from app/models/concerns/ticket/sets_online_notification_seen.rb rename to app/models/ticket/sets_online_notification_seen.rb diff --git a/app/models/concerns/ticket/touches_associations.rb b/app/models/ticket/touches_associations.rb similarity index 100% rename from app/models/concerns/ticket/touches_associations.rb rename to app/models/ticket/touches_associations.rb diff --git a/app/models/concerns/user/performs_geo_lookup.rb b/app/models/user/performs_geo_lookup.rb similarity index 100% rename from app/models/concerns/user/performs_geo_lookup.rb rename to app/models/user/performs_geo_lookup.rb diff --git a/app/models/concerns/user/touches_organization.rb b/app/models/user/touches_organization.rb similarity index 100% rename from app/models/concerns/user/touches_organization.rb rename to app/models/user/touches_organization.rb diff --git a/app/models/concerns/user/updates_ticket_organization.rb b/app/models/user/updates_ticket_organization.rb similarity index 100% rename from app/models/concerns/user/updates_ticket_organization.rb rename to app/models/user/updates_ticket_organization.rb diff --git a/spec/models/concerns/tag/writes_to_ticket_history_examples.rb b/spec/models/tag/writes_to_ticket_history_examples.rb similarity index 100% rename from spec/models/concerns/tag/writes_to_ticket_history_examples.rb rename to spec/models/tag/writes_to_ticket_history_examples.rb diff --git a/spec/models/concerns/ticket/article/adds_metadata_general_spec.rb b/spec/models/ticket/article/adds_metadata_general_spec.rb similarity index 100% rename from spec/models/concerns/ticket/article/adds_metadata_general_spec.rb rename to spec/models/ticket/article/adds_metadata_general_spec.rb diff --git a/spec/models/concerns/ticket/article/enqueue_communicate_email_job_spec.rb b/spec/models/ticket/article/enqueue_communicate_email_job_spec.rb similarity index 100% rename from spec/models/concerns/ticket/article/enqueue_communicate_email_job_spec.rb rename to spec/models/ticket/article/enqueue_communicate_email_job_spec.rb diff --git a/spec/models/concerns/ticket/article/enqueue_communicate_facebook_job_spec.rb b/spec/models/ticket/article/enqueue_communicate_facebook_job_spec.rb similarity index 100% rename from spec/models/concerns/ticket/article/enqueue_communicate_facebook_job_spec.rb rename to spec/models/ticket/article/enqueue_communicate_facebook_job_spec.rb diff --git a/spec/models/concerns/ticket/article/enqueue_communicate_sms_job_spec.rb b/spec/models/ticket/article/enqueue_communicate_sms_job_spec.rb similarity index 100% rename from spec/models/concerns/ticket/article/enqueue_communicate_sms_job_spec.rb rename to spec/models/ticket/article/enqueue_communicate_sms_job_spec.rb diff --git a/spec/models/concerns/ticket/article/enqueue_communicate_telegram_job_spec.rb b/spec/models/ticket/article/enqueue_communicate_telegram_job_spec.rb similarity index 100% rename from spec/models/concerns/ticket/article/enqueue_communicate_telegram_job_spec.rb rename to spec/models/ticket/article/enqueue_communicate_telegram_job_spec.rb diff --git a/spec/models/concerns/ticket/article/enqueue_communicate_twitter_job_spec.rb b/spec/models/ticket/article/enqueue_communicate_twitter_job_spec.rb similarity index 100% rename from spec/models/concerns/ticket/article/enqueue_communicate_twitter_job_spec.rb rename to spec/models/ticket/article/enqueue_communicate_twitter_job_spec.rb diff --git a/spec/models/concerns/ticket/calls_stats_ticket_reopen_log_examples.rb b/spec/models/ticket/calls_stats_ticket_reopen_log_examples.rb similarity index 100% rename from spec/models/concerns/ticket/calls_stats_ticket_reopen_log_examples.rb rename to spec/models/ticket/calls_stats_ticket_reopen_log_examples.rb diff --git a/spec/models/concerns/ticket/enqueues_user_ticket_counter_job_examples.rb b/spec/models/ticket/enqueues_user_ticket_counter_job_examples.rb similarity index 100% rename from spec/models/concerns/ticket/enqueues_user_ticket_counter_job_examples.rb rename to spec/models/ticket/enqueues_user_ticket_counter_job_examples.rb diff --git a/spec/models/concerns/ticket/resets_pending_time_seconds_examples.rb b/spec/models/ticket/resets_pending_time_seconds_examples.rb similarity index 100% rename from spec/models/concerns/ticket/resets_pending_time_seconds_examples.rb rename to spec/models/ticket/resets_pending_time_seconds_examples.rb diff --git a/spec/models/concerns/ticket/sets_close_time_examples.rb b/spec/models/ticket/sets_close_time_examples.rb similarity index 100% rename from spec/models/concerns/ticket/sets_close_time_examples.rb rename to spec/models/ticket/sets_close_time_examples.rb diff --git a/spec/models/concerns/ticket/sets_last_owner_update_time_examples.rb b/spec/models/ticket/sets_last_owner_update_time_examples.rb similarity index 100% rename from spec/models/concerns/ticket/sets_last_owner_update_time_examples.rb rename to spec/models/ticket/sets_last_owner_update_time_examples.rb diff --git a/spec/models/ticket_spec.rb b/spec/models/ticket_spec.rb index 9b58f6c2d..82e2524c1 100644 --- a/spec/models/ticket_spec.rb +++ b/spec/models/ticket_spec.rb @@ -4,16 +4,16 @@ require 'models/concerns/can_be_imported_examples' require 'models/concerns/can_csv_import_examples' require 'models/concerns/has_history_examples' require 'models/concerns/has_tags_examples' -require 'models/concerns/tag/writes_to_ticket_history_examples' require 'models/concerns/has_taskbars_examples' require 'models/concerns/has_xss_sanitized_note_examples' require 'models/concerns/has_object_manager_attributes_validation_examples' -require 'models/concerns/ticket/calls_stats_ticket_reopen_log_examples' -require 'models/concerns/ticket/enqueues_user_ticket_counter_job_examples' -require 'models/concerns/ticket/resets_pending_time_seconds_examples' -require 'models/concerns/ticket/sets_close_time_examples' -require 'models/concerns/ticket/sets_last_owner_update_time_examples' +require 'models/tag/writes_to_ticket_history_examples' +require 'models/ticket/calls_stats_ticket_reopen_log_examples' +require 'models/ticket/enqueues_user_ticket_counter_job_examples' require 'models/ticket/escalation_examples' +require 'models/ticket/resets_pending_time_seconds_examples' +require 'models/ticket/sets_close_time_examples' +require 'models/ticket/sets_last_owner_update_time_examples' RSpec.describe Ticket, type: :model do subject(:ticket) { create(:ticket) } diff --git a/spec/models/concerns/user/performs_geo_lookup_examples.rb b/spec/models/user/performs_geo_lookup_examples.rb similarity index 100% rename from spec/models/concerns/user/performs_geo_lookup_examples.rb rename to spec/models/user/performs_geo_lookup_examples.rb diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index bc04eb952..10477a173 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -7,9 +7,9 @@ require 'models/concerns/has_groups_permissions_examples' require 'models/concerns/has_xss_sanitized_note_examples' require 'models/concerns/can_be_imported_examples' require 'models/concerns/has_object_manager_attributes_validation_examples' -require 'models/concerns/user/performs_geo_lookup_examples' -require 'models/user/has_ticket_create_screen_impact_examples' require 'models/user/can_lookup_search_index_attributes_examples' +require 'models/user/has_ticket_create_screen_impact_examples' +require 'models/user/performs_geo_lookup_examples' require 'models/concerns/has_taskbars_examples' RSpec.describe User, type: :model do