mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 05:30:48 +08:00
Apply embed unlisted setting consistently (#24294)
Applies the embed_unlisted site setting consistently across topic embeds, including those created via the WP Discourse plugin. Relatedly, adds a embed exception to can_create_unlisted_topic? check. Users creating embedded topics are not always staff.
This commit is contained in:
@ -641,6 +641,18 @@ RSpec.describe TopicCreator do
|
||||
it "is valid for an admin" do
|
||||
expect(TopicCreator.new(admin, Guardian.new(admin), unlisted_attrs).valid?).to eq(true)
|
||||
end
|
||||
|
||||
context "when embedded" do
|
||||
let(:embedded_unlisted_attrs) do
|
||||
unlisted_attrs.merge(embed_url: "http://eviltrout.com/stupid-url")
|
||||
end
|
||||
|
||||
it "is valid for a non-staff user" do
|
||||
expect(TopicCreator.new(user, Guardian.new(user), embedded_unlisted_attrs).valid?).to eq(
|
||||
true,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user