about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-28 11:11:18 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-06-28 11:11:18 +0200
commitfe5f6bc7edf42e8c87dbdfa98f5707020e42d400 (patch)
tree2e632dfa964aad5cf118930389cf95904f3bd82a /lib/tasks
parent63f79874b59b3ba28c0f940b9d36ea7aacb44c93 (diff)
parent02851848e964675bb59919fa5fd1bdee2c1c29db (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-image.yml`:
  Fix erroneous deletion in a previous merge.
- `Gemfile`:
  Conflict caused by glitch-soc-only hCaptcha dependency
- `app/controllers/auth/sessions_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `app/controllers/filters_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `app/serializers/rest/status_serializer.rb`:
  Minor conflict due to glitch-soc having an extra `local_only` property
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/tests.rake18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/tasks/tests.rake b/lib/tasks/tests.rake
index 0f3b44a74..65bff6a8e 100644
--- a/lib/tasks/tests.rake
+++ b/lib/tasks/tests.rake
@@ -38,10 +38,26 @@ namespace :tests do
         puts 'Instance actor does not have a private key'
         exit(1)
       end
+
+      unless Account.find_by(username: 'user', domain: nil).custom_filters.map { |filter| filter.keywords.pluck(:keyword) } == [['test'], ['take']]
+        puts 'CustomFilterKeyword records not created as expected'
+        exit(1)
+      end
+    end
+
+    desc 'Populate the database with test data for 2.4.3'
+    task populate_v2_4_3: :environment do # rubocop:disable Naming/VariableNumber
+      ActiveRecord::Base.connection.execute(<<~SQL)
+        INSERT INTO "custom_filters"
+          (id, account_id, phrase, context, whole_word, irreversible, created_at, updated_at)
+        VALUES
+          (1, 2, 'test', '{ "home", "public" }', true, true, now(), now()),
+          (2, 2, 'take', '{ "home" }', false, false, now(), now());
+      SQL
     end
 
     desc 'Populate the database with test data for 2.4.0'
-    task populate_v2_4: :environment do
+    task populate_v2_4: :environment do # rubocop:disable Naming/VariableNumber
       ActiveRecord::Base.connection.execute(<<~SQL)
         INSERT INTO "settings"
           (id, thing_type, thing_id, var, value, created_at, updated_at)