Alan Guo Xiang Tan
243fcb6ffc
DEV: Introduce run_theme_migration spec helper in test environment ( #26845 )
...
This commit introduces the `run_theme_migration` spec helper to allow
theme developers to write RSpec tests for theme migrations. For example,
this allows the following RSpec test to be written in themes:
```
RSpec.describe "0003-migrate-small-links-setting migration" do
let!(:theme) { upload_theme_component }
it "should set target property to `_blank` if previous target component is not valid or empty" do
theme.theme_settings.create!(
name: "small_links",
theme: theme,
data_type: ThemeSetting.types[:string],
value: "some text, #|some text 2, #, invalid target",
)
run_theme_migration(theme, "0003-migrate-small-links-setting")
expect(theme.settings[:small_links].value).to eq(
[
{ "text" => "some text", "url" => "#", "target" => "_blank" },
{ "text" => "some text 2", "url" => "#", "target" => "_blank" },
],
)
end
end
```
This change is being introduced because we realised that writting just
javascript tests for the migrations is insufficient since javascript
tests do not ensure that the migrated theme settings can actually be
successfully saved into the database. Hence, we are introduce this
helper as a way for theme developers to write "end-to-end" migrations
tests.
2024-05-03 06:29:18 +08:00
..
2024-04-29 15:12:47 +10:00
2024-04-23 09:52:01 -04:00
2024-03-20 08:52:25 +08:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2020-07-20 15:23:49 -06:00
2023-01-09 14:14:59 +00:00
2024-03-14 15:24:54 -06:00
2023-11-29 16:38:07 +11:00
2024-04-25 11:00:01 +01:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2019-10-17 16:58:21 +11:00
2019-10-17 16:58:21 +11:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-02-13 12:39:45 +08:00
2023-05-15 09:54:54 +02:00
2019-05-13 09:31:32 +08:00
2024-02-02 14:09:55 +08:00
2023-01-09 14:14:59 +00:00
2023-11-29 16:38:07 +11:00
2019-05-13 09:31:32 +08:00
2023-12-14 11:06:21 -06:00
2023-09-25 19:38:54 +03:00
2023-02-23 11:18:14 -08:00
2023-01-09 14:14:59 +00:00
2024-03-28 18:19:09 +02:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2019-05-13 09:31:32 +08:00
2023-09-12 09:51:49 +08:00
2023-01-09 14:14:59 +00:00
2023-05-18 12:46:44 +03:00
2023-01-09 14:14:59 +00:00
2023-07-13 09:02:23 +10:00
2024-04-25 16:47:45 +03:00
2023-01-09 14:14:59 +00:00
2020-08-20 17:10:33 -07:00
2023-01-09 14:14:59 +00:00
2024-01-31 09:32:38 +01:00
2022-06-09 09:24:30 +10:00
2023-08-18 10:59:11 -05:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-03-11 15:19:37 +05:30
2019-05-13 09:31:32 +08:00
2021-02-04 11:27:34 +11:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-09-12 15:31:26 -03:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-12-06 13:18:34 +01:00
2023-11-29 16:38:07 +11:00
2023-01-25 13:50:45 +02:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-04-13 15:38:54 +08:00
2023-11-29 16:38:07 +11:00
2023-08-29 18:41:33 -03:00
2023-01-09 14:14:59 +00:00
2024-03-28 10:18:19 +08:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-12-14 11:06:21 -06:00
2023-01-09 14:14:59 +00:00
2019-05-13 09:31:32 +08:00
2023-05-24 09:57:46 +02:00
2023-01-09 14:14:59 +00:00
2024-02-08 09:43:34 +10:00
2024-02-12 12:36:00 +10:00
2021-07-06 10:11:06 +01:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-03-04 13:50:01 +10:00
2023-02-13 12:39:45 +08:00
2024-02-08 11:17:59 -05:00
2019-05-13 09:31:32 +08:00
2024-03-27 09:12:14 -04:00
2024-03-15 14:24:07 +08:00
2021-03-09 00:15:14 +02:00
2021-03-06 13:29:35 +02:00
2023-11-28 11:28:40 +00:00
2023-01-09 14:14:59 +00:00
2020-11-02 12:18:48 +05:30
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-10-09 07:24:10 +08:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-04-09 11:53:37 -06:00
2023-01-09 14:14:59 +00:00
2019-05-13 09:31:32 +08:00
2024-01-16 14:33:16 +01:00
2024-02-05 17:31:31 +01:00
2019-05-13 09:31:32 +08:00
2023-01-09 14:14:59 +00:00
2024-02-07 10:12:22 +08:00
2023-10-27 10:02:14 +08:00
2023-11-08 23:13:25 +04:00
2024-04-03 18:20:43 +03:00
2023-01-09 14:14:59 +00:00
2023-06-20 09:49:22 +08:00
2023-11-13 11:06:25 +08:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-04-10 17:35:42 +03:00
2020-10-27 23:42:33 +05:30
2019-05-13 09:31:32 +08:00
2023-11-08 23:13:25 +04:00
2024-04-19 18:10:50 +10:00
2024-04-29 10:34:46 +10:00
2023-01-09 14:14:59 +00:00
2024-03-18 18:05:46 +01:00
2024-03-27 10:07:56 +08:00
2024-03-28 14:00:47 +08:00
2023-01-20 12:52:49 -06:00
2021-07-06 10:11:06 +01:00
2023-02-13 12:39:45 +08:00
2024-01-11 14:04:02 +08:00
2023-01-09 14:14:59 +00:00
2024-04-25 11:00:01 +01:00
2023-01-09 14:14:59 +00:00
2024-01-02 18:32:50 +08:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-11-20 09:50:09 +10:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-10-13 11:28:31 +10:00
2023-10-13 11:28:31 +10:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-02-13 12:39:45 +08:00
2023-01-20 12:52:49 -06:00
2023-12-06 13:18:34 +01:00
2023-11-20 10:43:58 +10:00
2019-05-13 09:31:32 +08:00
2021-07-06 10:11:06 +01:00
2023-04-05 10:52:18 +10:00
2024-04-25 13:21:39 -05:00
2024-03-20 12:55:40 +00:00
2019-05-13 09:31:32 +08:00
2024-02-08 09:43:34 +10:00
2024-02-16 16:39:18 +02:00
2024-03-21 13:19:53 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-04-04 00:22:28 +05:30
2023-01-09 14:14:59 +00:00
2023-06-13 14:21:46 -03:00
2023-07-20 15:25:46 -03:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2023-12-06 13:18:34 +01:00
2019-05-13 09:31:32 +08:00
2023-12-06 23:25:00 +01:00
2023-12-15 23:46:04 +08:00
2024-03-19 07:03:49 +11:00
2024-04-02 11:05:08 -04:00
2024-04-04 12:01:31 +08:00
2024-05-03 06:29:18 +08:00
2023-07-12 09:49:28 -05:00
2022-02-21 09:45:14 +00:00
2024-05-03 06:29:18 +08:00
2019-05-13 09:31:32 +08:00
2023-01-09 14:14:59 +00:00
2023-01-12 14:03:26 -06:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2023-02-13 12:39:45 +08:00
2024-04-03 18:20:43 +03:00
2024-04-05 12:37:53 -03:00
2023-01-09 14:14:59 +00:00
2023-02-21 10:30:48 +01:00
2024-02-15 18:27:54 +11:00
2019-05-13 09:31:32 +08:00
2023-06-16 11:26:26 +08:00
2024-01-30 17:03:58 +11:00
2024-03-21 19:51:41 +02:00
2023-01-09 14:14:59 +00:00
2023-05-31 19:32:06 +05:30
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2019-05-13 09:31:32 +08:00
2023-01-20 09:50:24 +08:00
2023-01-09 14:14:59 +00:00
2023-12-06 23:25:00 +01:00
2024-03-15 12:08:37 -04:00
2024-04-19 18:10:50 +10:00
2023-01-09 14:14:59 +00:00
2024-04-29 10:34:46 +10:00
2023-07-19 23:06:13 +08:00
2023-12-06 13:18:34 +01:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-04-16 14:10:25 +10:00
2024-02-16 07:39:49 +08:00
2024-04-11 15:54:28 -06:00
2024-03-15 16:06:32 -04:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2019-05-13 09:31:32 +08:00
2023-01-09 14:14:59 +00:00
2019-05-13 09:31:32 +08:00
2024-01-12 13:06:29 +08:00
2024-01-22 18:33:39 +01:00
2023-11-29 16:38:07 +11:00
2023-01-09 14:14:59 +00:00
2024-04-17 17:23:47 +03:00
2024-04-03 18:20:43 +03:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2021-07-30 13:50:47 -04:00
2024-04-25 20:58:34 +08:00
2024-04-29 15:50:55 +05:30
2020-10-27 23:42:33 +05:30
2023-01-09 14:14:59 +00:00
2020-02-07 17:32:35 +00:00
2024-04-29 17:20:01 +08:00
2023-01-09 14:14:59 +00:00
2023-08-09 20:56:14 +02:00
2019-05-13 09:31:32 +08:00
2024-02-26 17:40:48 +04:00
2023-09-12 15:31:17 -03:00
2023-09-12 15:31:17 -03:00
2024-02-08 09:43:34 +10:00
2023-01-30 10:49:08 +02:00
2024-04-03 14:20:54 -06:00
2019-05-13 09:31:32 +08:00
2023-01-09 14:14:59 +00:00
2023-01-09 14:14:59 +00:00
2024-04-24 00:20:14 +05:30
2024-04-04 15:02:09 +02:00
2024-04-30 19:16:47 +02:00
2024-04-29 15:50:55 +05:30
2023-02-13 12:39:45 +08:00
2024-03-05 12:47:04 +11:00
2023-10-09 03:35:31 +00:00
2023-01-09 14:14:59 +00:00
2023-10-09 03:35:31 +00:00