discourse/spec/models
Martin Brennan fb83757edb
FIX: Auto close topic from category settings based on topic created_at (#12082)
Previously when inheriting category auto-close settings for a topic, those settings were disrupted if another topic timer was assigned or if a topic was closed then manually re-opened.

This PR makes it so that when a topic is manually re-opened the topic auto-close settings are inherited from the category. However, they will now be based on the topic created_at date. As an example, for a topic with a category auto close hours setting of 72 (3 days):

* Topic was created on 2021-02-15 08:00
* Topic was closed on 2021-02-16 10:00
* Topic was opened again on 2021-02-17 06:00

Now, the topic will inherit the auto close timer again and will close automatically at **2021-02-18 08:00**, which is based on the creation date. If the current date and time is greater than the original auto-close time (e.g. we were at 2021-02-20 13:45) then no auto-close timer is created.

Note, this will not happen if the topic category auto-close setting is "based on last post".
2021-02-17 07:51:39 +10:00
..
about_spec.rb
admin_dashboard_problem_spec.rb
api_key_spec.rb REFACTOR: Introduce RouteMatcher class 2020-10-19 10:40:55 +01:00
application_request_spec.rb DEV: Clean up some Redis leaks in test env. 2020-05-18 17:27:37 +08:00
badge_spec.rb FIX: error customizing text for badges from plugins 2020-04-28 14:34:41 -04:00
badge_type_spec.rb
bookmark_spec.rb FEATURE: Add weekly bookmark cleanup code (#10899) 2020-10-14 09:38:57 +10:00
category_featured_topic_spec.rb
category_group_spec.rb
category_list_spec.rb DEV: Refactor draft attributes for CategoryList and TopicList. 2020-07-24 10:11:30 +08:00
category_spec.rb FIX: Make category slugs lowercase (#11277) 2021-01-12 17:28:33 +02:00
category_user_spec.rb
child_theme_spec.rb
color_scheme_color_spec.rb
color_scheme_spec.rb FEATURE: WCAG compliant color schemes (#10882) 2020-10-15 14:05:48 -04:00
developer_spec.rb
digest_email_site_setting_spec.rb
directory_item_spec.rb
discourse_single_sign_on_spec.rb FEATURE: Rename 'Discourse SSO' to DiscourseConnect (#11978) 2021-02-08 10:04:33 +00:00
do_not_disturb_timing_spec.rb FEATURE: Do not disturb (#11484) 2020-12-18 09:03:51 -06:00
draft_sequence_spec.rb FIX: Always return 0 for non-human user current DraftSequence. 2020-05-15 10:40:36 +08:00
draft_spec.rb FEATURE: composer option to reload page and force save draft (#10773) 2020-09-29 22:29:03 +05:30
email_change_request_spec.rb
email_log_spec.rb
email_token_spec.rb FEATURE: multiple use invite links (#9813) 2020-06-09 20:49:32 +05:30
embeddable_host_spec.rb FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
emoji_spec.rb
given_daily_like_spec.rb
global_setting_spec.rb FIX: use Redis replica host and port (#11566) 2020-12-23 13:14:19 +11:00
group_history_spec.rb
group_spec.rb DEV: Ensure DiscourseEvent handlers cleaned up during specs (#11205) 2020-11-11 19:46:13 +00:00
group_user_spec.rb linting (#10644) 2020-09-10 11:34:48 +02:00
incoming_link_spec.rb
incoming_links_report_spec.rb
invite_redeemer_spec.rb FIX: Support for single use invite links (#11719) 2021-01-20 10:50:02 +02:00
invite_spec.rb FEATURE: Rename 'Discourse SSO' to DiscourseConnect (#11978) 2021-02-08 10:04:33 +00:00
javascript_cache_spec.rb
locale_site_setting_spec.rb FEATURE: Add English (UK) as locale (#11768) 2021-01-20 21:32:22 +01:00
mailing_list_mode_site_setting_spec.rb
notification_spec.rb DEV: Replace 'processed' column on notifications with new table (#11864) 2021-01-27 10:29:24 -06:00
optimized_image_spec.rb DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
permalink_spec.rb DEV: Deprecate Category#url_with_id in favor of Category#url (#9972) 2020-06-18 11:32:14 +03:00
plugin_store_spec.rb
post_action_spec.rb DEV: Change Topic Timer from enqueue_at scheduled jobs to incrementally executed jobs (#11698) 2021-01-19 13:30:58 +10:00
post_action_type_spec.rb
post_analyzer_spec.rb FIX - limit number of embedded media items in a post (#10391) 2020-08-07 12:08:59 -04:00
post_detail_spec.rb
post_mover_spec.rb FIX: correct link in the notification about moved post (#11399) 2020-12-04 08:43:42 +11:00
post_reply_key_spec.rb
post_reply_spec.rb
post_spec.rb DEV: Add security_last_changed_at and security_last_changed_reason to uploads (#11860) 2021-01-29 09:03:44 +10:00
post_timing_spec.rb PERF: Keep track of first unread PM and first unread group PM for user. 2020-09-09 14:05:41 +08:00
post_upload_spec.rb
published_page_spec.rb FEATURE: Support for publishing topics as pages (#9364) 2020-04-08 12:52:36 -04:00
quoted_post_spec.rb
remote_theme_spec.rb FIX: Gracefully handle force pushes for remote themes (#11325) 2020-11-23 15:29:22 +02:00
report_spec.rb FIX: Only cache reports with exceptions for 1 minute (#11447) 2020-12-09 10:54:41 -06:00
reviewable_claimed_topic_spec.rb
reviewable_flagged_post_spec.rb FEATURE: Unassign the review queue topic when a flag is handled 2020-03-24 14:57:44 -07:00
reviewable_history_spec.rb
reviewable_queued_post_spec.rb FIX: Return 422 when creating topics with tags w/out permission (#10400) 2020-08-10 16:14:15 -06:00
reviewable_score_spec.rb
reviewable_spec.rb FEATURE: Reviewed by filter. (#11405) 2020-12-04 14:09:05 -03:00
reviewable_user_spec.rb FEATURE: reason to reject user signup (#11700) 2021-01-15 09:43:26 +11:00
s3_region_site_setting_spec.rb
screened_email_spec.rb FEATURE: when blocking emails prefer blocking canonical 2020-04-24 14:09:51 +10:00
screened_ip_address_spec.rb FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
screened_url_spec.rb
search_log_spec.rb
site_setting_spec.rb FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
site_spec.rb UX: Improve color scheme choices in user prefs (#11656) 2021-01-07 11:15:38 -05:00
skipped_email_log_spec.rb
stylesheet_cache_spec.rb
tag_group_spec.rb
tag_spec.rb FIX: URL encode tag name (#11393) 2020-12-02 12:36:41 +05:30
tag_user_spec.rb Tag groups can belong to groups (#10854) 2020-10-14 13:15:54 -04:00
theme_field_spec.rb DEV: Refactor theme SCSS compilation (#11919) 2021-02-02 13:09:41 -05:00
theme_modifier_set_spec.rb
theme_spec.rb FIX: Improve SCSS handling in components (#11963) 2021-02-04 08:51:18 -05:00
top_menu_item_spec.rb
top_topic_spec.rb
topic_allowed_user_spec.rb
topic_converter_spec.rb FIX: Limit personal message participants when converting from topic (#9343) 2020-04-03 16:42:01 +01:00
topic_embed_spec.rb DEV: More robust processing of URLs (#11361) 2020-12-03 17:16:01 -05:00
topic_featured_users_spec.rb
topic_group_spec.rb
topic_invite_spec.rb
topic_link_click_spec.rb DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
topic_link_spec.rb PERF: avoid race conditions when creating topic links 2020-05-13 16:05:57 +10:00
topic_list_spec.rb FIX: Build correct topic list filter (#11473) 2020-12-11 14:20:48 +02:00
topic_participants_summary_spec.rb
topic_posters_summary_spec.rb Fix i18n issues reported on Crowdin (#11747) 2021-02-02 10:50:04 +01:00
topic_spec.rb FIX: Auto close topic from category settings based on topic created_at (#12082) 2021-02-17 07:51:39 +10:00
topic_tag_spec.rb
topic_thumbnail_spec.rb PERF: we don't need to use a huge image to test thumbnails (#11025) 2020-10-27 12:39:52 +11:00
topic_timer_spec.rb FIX: Validate duration minutes values for topic timer (#12040) 2021-02-12 09:05:14 +10:00
topic_tracking_state_spec.rb FEATURE: New way to dismiss new topics (#11927) 2021-02-04 11:27:34 +11:00
topic_user_spec.rb DEV: Ensure DiscourseEvent handlers cleaned up during specs (#11205) 2020-11-11 19:46:13 +00:00
topic_view_item_spec.rb
translation_override_spec.rb FIX: deprecate whitelist constants (#10716) 2020-09-28 13:52:05 +10:00
trust_level3_requirements_spec.rb DEV: Update tl3 spec to remove hard-coded primary keys 2020-04-17 17:24:14 +01:00
unsubscribe_key_spec.rb
upload_spec.rb DEV: Add security_last_changed_at and security_last_changed_reason to uploads (#11860) 2021-01-29 09:03:44 +10:00
user_action_spec.rb
user_api_key_spec.rb REFACTOR: Introduce RouteMatcher class 2020-10-19 10:40:55 +01:00
user_archived_message_spec.rb
user_auth_token_spec.rb
user_avatar_spec.rb FIX: reset gravatar cache by adding random param to URL (#9370) 2020-04-08 07:35:42 +10:00
user_badge_spec.rb
user_bookmark_list_spec.rb FIX: Add bookmark limits (#11725) 2021-01-19 08:53:49 +10:00
user_email_spec.rb FIX: : trigger user_updated event only if email changed after user creation. 2020-07-16 18:21:30 +05:30
user_export_spec.rb
user_field_spec.rb
user_history_spec.rb
user_notification_schedule_spec.rb FEATURE: Create notification schedule to automatically set do not disturb time (#11665) 2021-01-20 10:31:52 -06:00
user_option_spec.rb FEATURE: add new user option skip_new_user_tips. (#10437) 2020-08-14 19:10:56 +05:30
user_profile_spec.rb FIX: Make sure rel attributes are correctly set. (#10645) 2020-09-10 12:59:51 -03:00
user_profile_view_spec.rb
user_search_spec.rb FIX: only de-prioritise exact matches in mentions (#11843) 2021-01-25 21:27:15 +01:00
user_second_factor_spec.rb
user_spec.rb FIX: Return the CDN's URL when using the site's small logo as the system's user avatar. 2021-02-01 10:31:36 +08:00
user_stat_spec.rb PERF: Keep track of first unread PM and first unread group PM for user. 2020-09-09 14:05:41 +08:00
user_summary_spec.rb
user_visit_spec.rb
username_validator_spec.rb FIX: use allowlist and blocklist terminology (#10209) 2020-07-27 10:23:54 +10:00
watched_word_spec.rb
web_crawler_request_spec.rb
web_hook_event_spec.rb
web_hook_spec.rb FEATURE: Webhooks and Event for user being granted a badge 2020-04-08 14:38:30 -07:00