mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Block accidental serialization of entire AR models (#27668)
This commit is contained in:
@@ -108,6 +108,11 @@ RSpec.describe "notifications" do
|
||||
response "200", "notifications marked read" do
|
||||
schema type: :object, properties: { success: { type: :string } }
|
||||
|
||||
let(:notification) do
|
||||
notification = Fabricate(:notification)
|
||||
NotificationSerializer.new(notification).as_json
|
||||
end
|
||||
|
||||
run_test!
|
||||
end
|
||||
end
|
||||
|
||||
@@ -221,7 +221,10 @@ RSpec.describe "posts" do
|
||||
expected_response_schema = load_spec_schema("topic_create_response")
|
||||
schema expected_response_schema
|
||||
|
||||
let(:params) { Fabricate(:post) }
|
||||
let(:params) do
|
||||
post = Fabricate(:post)
|
||||
post.serializable_hash(only: %i[topic_id raw created_at]).as_json
|
||||
end
|
||||
|
||||
it_behaves_like "a JSON endpoint", 200 do
|
||||
let(:expected_response_schema) { expected_response_schema }
|
||||
|
||||
Reference in New Issue
Block a user