mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
added a test for safe mode
This commit is contained in:
@ -313,4 +313,24 @@ describe ListController do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "safe mode" do
|
||||||
|
render_views
|
||||||
|
|
||||||
|
it "handles safe mode" do
|
||||||
|
get :latest
|
||||||
|
expect(response.body).to match(/plugin\.js/)
|
||||||
|
expect(response.body).to match(/plugin-third-party\.js/)
|
||||||
|
|
||||||
|
get :latest, safe_mode: "no_plugins"
|
||||||
|
expect(response.body).not_to match(/plugin\.js/)
|
||||||
|
expect(response.body).not_to match(/plugin-third-party\.js/)
|
||||||
|
|
||||||
|
get :latest, safe_mode: "only_official"
|
||||||
|
expect(response.body).to match(/plugin\.js/)
|
||||||
|
expect(response.body).not_to match(/plugin-third-party\.js/)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user