mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 04:06:28 +08:00
20 lines
437 B
Ruby
20 lines
437 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Admin::FlaggedTopicsController do
|
|
let(:admin) { Fabricate(:admin) }
|
|
let!(:flag) { Fabricate(:flag) }
|
|
|
|
before do
|
|
sign_in(admin)
|
|
end
|
|
|
|
it "returns a list of flagged topics" do
|
|
get "/admin/flagged_topics.json"
|
|
expect(response).to be_success
|
|
|
|
data = ::JSON.parse(response.body)
|
|
expect(data['flagged_topics']).to be_present
|
|
expect(data['users']).to be_present
|
|
end
|
|
end
|