mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-07 02:11:04 +00:00
Add some tests
This commit is contained in:
parent
9c9dd66129
commit
6205d42462
|
@ -289,6 +289,8 @@ RSpec.describe Settings::ImportsController do
|
|||
it_behaves_like 'successful import', 'domain_blocking', 'domain_blocks.csv', 'overwrite'
|
||||
it_behaves_like 'successful import', 'bookmarks', 'bookmark-imports.txt', 'merge'
|
||||
it_behaves_like 'successful import', 'bookmarks', 'bookmark-imports.txt', 'overwrite'
|
||||
it_behaves_like 'successful import', 'filters', 'filters.csv', 'merge'
|
||||
it_behaves_like 'successful import', 'filters', 'filters.csv', 'overwrite'
|
||||
|
||||
it_behaves_like 'unsuccessful import', 'following', 'domain_blocks.csv', 'merge'
|
||||
it_behaves_like 'unsuccessful import', 'following', 'domain_blocks.csv', 'overwrite'
|
||||
|
@ -296,6 +298,8 @@ RSpec.describe Settings::ImportsController do
|
|||
it_behaves_like 'unsuccessful import', 'blocking', 'domain_blocks.csv', 'overwrite'
|
||||
it_behaves_like 'unsuccessful import', 'muting', 'domain_blocks.csv', 'merge'
|
||||
it_behaves_like 'unsuccessful import', 'muting', 'domain_blocks.csv', 'overwrite'
|
||||
it_behaves_like 'unsuccessful import', 'filters', 'domain_blocks.csv', 'merge'
|
||||
it_behaves_like 'unsuccessful import', 'filters', 'domain_blocks.csv', 'overwrite'
|
||||
|
||||
it_behaves_like 'unsuccessful import', 'following', 'empty.csv', 'merge'
|
||||
it_behaves_like 'unsuccessful import', 'following', 'empty.csv', 'overwrite'
|
||||
|
|
4
spec/fixtures/files/filters.csv
vendored
4
spec/fixtures/files/filters.csv
vendored
|
@ -0,0 +1,4 @@
|
|||
Title,Context,Keywords,Whole Word,Action,Expire after
|
||||
current events,"[""home"", ""public"", ""account""]","[""minions song contest""]",[true],warn,2025-08-14 21:33:29 UTC
|
||||
unwanted solicitations,"[""notifications"", ""thread""]","[""wizard school enrolment""]",[false],hide,
|
||||
scary things,"[""home"", ""public""]","[""flying sharks"", ""sapient crabs""]","[true, false]",blur,
|
|
|
@ -283,9 +283,9 @@ RSpec.describe Form::Import do
|
|||
]
|
||||
|
||||
it_behaves_like 'on successful import', 'filters', 'merge', 'filters.csv', [
|
||||
{ 'acct' => 'gargron@example.com', 'list_name' => 'Mastodon project' },
|
||||
{ 'acct' => 'mastodon@example.com', 'list_name' => 'Mastodon project' },
|
||||
{ 'acct' => 'foo@example.com', 'list_name' => 'test' },
|
||||
{ 'title' => 'current events', 'context' => %w(home public account), 'keywords' => ['minions song contest'], 'whole_word' => [true], 'action' => 'warn', 'expires_at' => Time.zone.parse('2025-08-14 21:33:29 UTC') },
|
||||
{ 'title' => 'unwanted solicitations', 'context' => %w(notifications thread), 'keywords' => ['wizard school enrolment'], 'whole_word' => [false], 'action' => 'hide', 'expires_at' => nil },
|
||||
{ 'title' => 'scary things', 'context' => %w(home public), 'keywords' => ['flying sharks', 'sapient crabs'], 'whole_word' => [true, false], 'action' => 'blur', 'expires_at' => nil },
|
||||
]
|
||||
|
||||
# Based on the bug report 20571 where UTF-8 encoded domains were rejecting import of their users
|
||||
|
|
Loading…
Reference in New Issue
Block a user