mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 19:38:24 +00:00
447d9b2105
This change converts the `approve_unless_trust_level` site setting to `approve_unless_allowed_groups`. See: https://meta.discourse.org/t/283408 - Adds the new site setting - Adds a deprecation warning - Updates core to use the new settings. - Adds a migration to fill in the new setting of the old setting was changed - Adds an entry to the site_setting.keywords section - Updates many tests to account for the new change After a couple of months we will remove the `approve_unless_trust_level` setting entirely. Internal ref: /t/115696
36 lines
1.2 KiB
Ruby
36 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Composer using review_media", type: :system do
|
|
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
|
fab!(:topic) { Fabricate(:topic, category: Category.find(SiteSetting.uncategorized_category_id)) }
|
|
fab!(:post) { Fabricate(:post, topic: topic) }
|
|
let(:topic_page) { PageObjects::Pages::Topic.new }
|
|
|
|
before do
|
|
SiteSetting.review_media_unless_trust_level = 3
|
|
sign_in user
|
|
end
|
|
|
|
it "does not flag a post with an emoji" do
|
|
topic_page.visit_topic_and_open_composer(topic)
|
|
topic_page.fill_in_composer(" this one has an emoji: :mask: ")
|
|
|
|
within(".d-editor-preview") { expect(page).to have_css(".emoji") }
|
|
topic_page.send_reply
|
|
|
|
expect(topic_page).to have_post_number(2)
|
|
expect(page).not_to have_css(".post-enqueued-modal")
|
|
end
|
|
|
|
it "flags a post with an image" do
|
|
topic_page.visit_topic_and_open_composer(topic)
|
|
topic_page.fill_in_composer(" this one has an upload: ")
|
|
|
|
attach_file "file-uploader", "#{Rails.root}/spec/fixtures/images/logo.jpg", make_visible: true
|
|
within(".d-editor-preview") { expect(page).to have_css("img") }
|
|
topic_page.send_reply
|
|
|
|
expect(page).to have_css(".post-enqueued-modal")
|
|
end
|
|
end
|