mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 20:01:11 +08:00
89ad2b5900
This updates tests to use latest rails 5 practice and updates ALL dependencies that could be updated Performance testing shows that performance has not regressed if anything it is marginally faster now.
34 lines
773 B
Ruby
34 lines
773 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Admin::FlaggedTopicsController do
|
|
let!(:flag) { Fabricate(:flag) }
|
|
|
|
shared_examples "successfully retrieve list of flagged topics" do
|
|
it "returns a list of flagged topics" do
|
|
get "/admin/flagged_topics.json"
|
|
expect(response).to be_successful
|
|
|
|
data = ::JSON.parse(response.body)
|
|
expect(data['flagged_topics']).to be_present
|
|
expect(data['users']).to be_present
|
|
end
|
|
end
|
|
|
|
context "as admin" do
|
|
before do
|
|
sign_in(Fabricate(:admin))
|
|
end
|
|
|
|
include_examples "successfully retrieve list of flagged topics"
|
|
end
|
|
|
|
context "as moderator" do
|
|
before do
|
|
sign_in(Fabricate(:moderator))
|
|
end
|
|
|
|
include_examples "successfully retrieve list of flagged topics"
|
|
end
|
|
|
|
end
|