mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-29 10:53:39 +00:00
Fix tests
This commit is contained in:
parent
9474197b43
commit
df53fb5bde
|
|
@ -235,11 +235,11 @@ RSpec.describe Settings::ImportsController do
|
|||
|
||||
let(:rows) do
|
||||
[
|
||||
{ 'title' => 'Invalid Filter', 'context' => ['waffles'], 'keywords' => ['mean stuff'], 'action' => 'hide', 'expires_at' => nil },
|
||||
{ 'title' => 'Invalid Filter', 'context' => ['waffles'], 'keywords' => ['mean stuff'], 'whole_word' => [true], 'action' => 'hide', 'expires_at' => nil },
|
||||
]
|
||||
end
|
||||
|
||||
it_behaves_like 'export failed rows', "Invalid Filter,\"[\"\"waffles\"\"]\",\"[\"\"mean stuff\"\"]\",hide,\n"
|
||||
it_behaves_like 'export failed rows', "Invalid Filter,\"[\"\"waffles\"\"]\",\"[\"\"mean stuff\"\"]\",[true],hide,\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,11 @@ RSpec.describe Export do
|
|||
end
|
||||
|
||||
describe '#to_filters_csv' do
|
||||
before { Fabricate.times(2, :custom_filter, account: account) }
|
||||
before do
|
||||
Fabricate.times(2, :custom_filter, account: account) do
|
||||
keywords { [Fabricate(:custom_filter_keyword)] }
|
||||
end
|
||||
end
|
||||
|
||||
let(:export) { CSV.parse(subject.to_filters_csv) }
|
||||
|
||||
|
|
@ -113,7 +117,8 @@ RSpec.describe Export do
|
|||
expect(export)
|
||||
.to contain_exactly(
|
||||
contain_exactly('Title', 'Context', 'Keywords', 'Whole Word', 'Action', 'Expire after'),
|
||||
include('discourse', '["home", "notifications"]', '["discourse"]', '[true]', 'warn', be_blank)
|
||||
include('discourse', '["home", "notifications"]', '["discourse"]', '[true]', 'warn', be_blank),
|
||||
include(be_present)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user