discourse/spec/requests/admin/flagged_topics_controller_spec.rb
2017-09-25 12:25:14 -04:00

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