mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
FIX: Ensure that post action moderation post uses the site's default locale.
https://meta.discourse.org/t/a-post-in-looking-for-someone-to-customize-discourse-to-create-a-forum-site-requires-staff-attention/67468/5?u=tgxworld
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe Admin::FlagsController do
|
||||
|
||||
it "is a subclass of AdminController" do
|
||||
expect(Admin::FlagsController < Admin::AdminController).to eq(true)
|
||||
end
|
||||
|
||||
context 'while logged in as an admin' do
|
||||
before do
|
||||
@user = log_in(:admin)
|
||||
end
|
||||
|
||||
context 'index' do
|
||||
it 'returns empty json when nothing is flagged' do
|
||||
xhr :get, :index
|
||||
|
||||
data = ::JSON.parse(response.body)
|
||||
expect(data["users"]).to eq([])
|
||||
expect(data["posts"]).to eq([])
|
||||
end
|
||||
|
||||
it 'returns a valid json payload when some thing is flagged' do
|
||||
p = Fabricate(:post)
|
||||
u = Fabricate(:user)
|
||||
|
||||
PostAction.act(u, p, PostActionType.types[:spam])
|
||||
xhr :get, :index
|
||||
|
||||
data = ::JSON.parse(response.body)
|
||||
data["users"].length == 2
|
||||
data["posts"].length == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user