mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Minor tweaks to Admin::WatchedWordsController.
This commit is contained in:
@@ -181,25 +181,4 @@ describe WatchedWord do
|
||||
}.to_not change { PostAction.count }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'upload' do
|
||||
context 'logged in as admin' do
|
||||
before do
|
||||
sign_in(admin)
|
||||
end
|
||||
|
||||
it 'creates the words from the file' do
|
||||
post '/admin/logs/watched_words/upload.json', params: {
|
||||
action_key: 'flag',
|
||||
file: Rack::Test::UploadedFile.new(file_from_fixtures("words.csv", "csv"))
|
||||
}
|
||||
expect(response.status).to eq(200)
|
||||
expect(WatchedWord.count).to eq(6)
|
||||
expect(WatchedWord.pluck(:word)).to contain_exactly(
|
||||
'thread', '线', 'धागा', '실', 'tråd', 'нить'
|
||||
)
|
||||
expect(WatchedWord.pluck(:action).uniq).to eq([WatchedWord.actions[:flag]])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user