discourse/spec
Osama Sayegh ce53152e53
DEV: Include theme_uploads and theme_uploads_local objects in theme tests (#18645)
Our theme system injects a magical `settings` object at the top of themes JS modules to allow theme authors to access the settings as configured by admins in the UI. Within this `settings` object, there are a couple of special objects `theme_uploads` and `theme_uploads_local` that contain URLs for all the assets/uploads that the theme has.

For test modules/files, the theme system also injects a `settings` object at the top of tests modules, but it's not the same object as the object that's injected in non-test files. The difference is that in tests we want the settings to have their default values as opposed to any custom values that may exist in the site's database. This ensures that test results are consistent no matter the site that runs them.

However, the `settings` object in tests files currently doesn't have the special objects `theme_uploads` and `theme_uploads_local` which means that if a theme includes an asset that's lazy-loaded, it's not possible to write tests for anything that depends on the lazy-loaded asset because the theme will not be able to load the asset during the tests since `theme_uploads_local` and `theme_uploads` don't exist. This PR adds these special objects inside the `settings` object for test files.

Internal topic: t/71825/52.
2022-10-20 08:00:29 +03:00
..
fabricators DEV: Add group messages and group_message_summary notifications in the messages tab in the user menu (#18390) 2022-09-30 08:44:04 +03:00
fixtures A11Y: Set role=presentation if alt attr is missing (#18546) 2022-10-12 14:07:37 +03:00
helpers Revert "Revert "FEATURE: Preload resources via link header (#18475)" (#18511)" (#18531) 2022-10-11 20:11:44 -03:00
import_export DEV: Add a rake task to export/import translation overrides (#18487) 2022-10-05 15:22:16 -04:00
initializers Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
integration DEV: Remove usages of enable_personal_messages (#18437) 2022-10-05 10:50:20 +10:00
integrity DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
jobs FEATURE: Add dark mode option for category logos (#18460) 2022-10-07 11:00:44 -04:00
lib FIX: Skip all post validations if necessary (#18625) 2022-10-19 18:54:32 +03:00
mailers DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
models FIX: do not include group less emojis in standard list (#18659) 2022-10-19 09:53:56 +02:00
multisite DEV: Rename secure_media to secure_uploads (#18376) 2022-09-29 09:24:33 +10:00
requests DEV: Include theme_uploads and theme_uploads_local objects in theme tests (#18645) 2022-10-20 08:00:29 +03:00
script/import_scripts DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
serializers FIX: sidebar_list_destination on CurrentUserSerializer (#18660) 2022-10-19 11:48:36 +11:00
services FEATURE: Generic hashtag autocomplete part 1 (#18592) 2022-10-19 14:03:57 +10:00
support UX: Hide tags section in sidebar when user has no visible tags (#18539) 2022-10-13 08:37:28 +08:00
system DEV: Minimal first pass of rails system test setup (#16311) 2022-09-28 11:48:16 +10:00
tasks DEV: Rename secure_media to secure_uploads (#18376) 2022-09-29 09:24:33 +10:00
views Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
rails_helper.rb FEATURE: Generic hashtag autocomplete part 1 (#18592) 2022-10-19 14:03:57 +10:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Fix openapi definition logo URL (#17038) 2022-06-08 13:10:20 +01:00