mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
Revert "Merge branch 'master' of https://github.com/discourse/discourse"
This reverts commit e62a85cf6fd81a2a34aff6144bd36b9ac459964a, reversing changes made to 2660c2e21d84bea667e1ea339f91cda352328062.
This commit is contained in:
@ -36,21 +36,5 @@ describe AboutController do
|
||||
expect(response.body).to include("<title>About - Discourse</title>")
|
||||
end
|
||||
end
|
||||
|
||||
it "serializes stats when 'Guardian#can_see_about_stats?' is true" do
|
||||
Guardian.any_instance.stubs(:can_see_about_stats?).returns(true)
|
||||
get "/about.json"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["about"].keys).to include("stats")
|
||||
end
|
||||
|
||||
it "does not serialize stats when 'Guardian#can_see_about_stats?' is false" do
|
||||
Guardian.any_instance.stubs(:can_see_about_stats?).returns(false)
|
||||
get "/about.json"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["about"].keys).not_to include("stats")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -35,7 +35,7 @@ RSpec.describe Admin::BackupsController do
|
||||
end
|
||||
|
||||
after do
|
||||
Discourse.redis.flushdb
|
||||
Discourse.redis.flushall
|
||||
|
||||
@paths&.each { |path| File.delete(path) if File.exists?(path) }
|
||||
@paths = nil
|
||||
|
@ -293,7 +293,7 @@ RSpec.describe Admin::UsersController do
|
||||
fab!(:another_user) { Fabricate(:coding_horror) }
|
||||
|
||||
after do
|
||||
Discourse.redis.flushdb
|
||||
Discourse.redis.flushall
|
||||
end
|
||||
|
||||
it "raises an error when the user doesn't have permission" do
|
||||
|
@ -128,7 +128,7 @@ RSpec.describe ListController do
|
||||
let(:moderator) { Fabricate(:moderator) }
|
||||
let(:admin) { Fabricate(:admin) }
|
||||
let(:tag) { Fabricate(:tag) }
|
||||
let(:private_message) { Fabricate(:private_message_topic, user: admin) }
|
||||
let(:private_message) { Fabricate(:private_message_topic) }
|
||||
|
||||
before do
|
||||
SiteSetting.tagging_enabled = true
|
||||
@ -149,17 +149,6 @@ RSpec.describe ListController do
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should work for tag with unicode name' do
|
||||
unicode_tag = Fabricate(:tag, name: 'hello-🇺🇸')
|
||||
Fabricate(:topic_tag, tag: unicode_tag, topic: private_message)
|
||||
|
||||
sign_in(admin)
|
||||
get "/topics/private-messages-tags/#{admin.username}/#{UrlHelper.encode_component(unicode_tag.name)}.json"
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["topic_list"]["topics"].first["id"])
|
||||
.to eq(private_message.id)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#private_messages_group' do
|
||||
|
@ -675,17 +675,6 @@ describe PostsController do
|
||||
I18n.t("invalid_params", message: "category")
|
||||
)
|
||||
end
|
||||
|
||||
it 'will raise an error if specified embed_url is invalid' do
|
||||
user = Fabricate(:admin)
|
||||
master_key = Fabricate(:api_key).key
|
||||
|
||||
post "/posts.json",
|
||||
params: { title: 'this is a test title', raw: 'this is test body', embed_url: '/test.txt' },
|
||||
headers: { HTTP_API_USERNAME: user.username, HTTP_API_KEY: master_key }
|
||||
|
||||
expect(response.status).to eq(422)
|
||||
end
|
||||
end
|
||||
|
||||
describe "when logged in" do
|
||||
|
@ -26,11 +26,11 @@ describe SearchController do
|
||||
before do
|
||||
# TODO be a bit more strategic here instead of junking
|
||||
# all of redis
|
||||
Discourse.redis.flushdb
|
||||
Discourse.redis.flushall
|
||||
end
|
||||
|
||||
after do
|
||||
Discourse.redis.flushdb
|
||||
Discourse.redis.flushall
|
||||
end
|
||||
|
||||
context "when overloaded" do
|
||||
|
@ -2127,7 +2127,7 @@ RSpec.describe TopicsController do
|
||||
let(:topic) { post.topic }
|
||||
|
||||
after do
|
||||
Discourse.redis.flushdb
|
||||
Discourse.redis.flushall
|
||||
end
|
||||
|
||||
it 'returns first post of the topic' do
|
||||
|
@ -3,7 +3,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe WebhooksController do
|
||||
before { Discourse.redis.flushdb }
|
||||
before { Discourse.redis.flushall }
|
||||
|
||||
let(:email) { "em@il.com" }
|
||||
let(:message_id) { "12345@il.com" }
|
||||
|
Reference in New Issue
Block a user