DEV: Remove setting explicit `id` on Fabricated property (#21831)

This commit is contained in:
Keegan George 2023-05-30 09:34:01 -07:00 committed by GitHub
parent 67102f7e4e
commit 093552bc84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -6,9 +6,9 @@ RSpec.describe FormTemplatesController do
before { SiteSetting.experimental_form_templates = true }
describe "#index" do
fab!(:form_template) { Fabricate(:form_template, id: 2) }
fab!(:form_template_2) { Fabricate(:form_template, id: 1) }
fab!(:form_template_3) { Fabricate(:form_template, id: 3) }
fab!(:form_template) { Fabricate(:form_template) }
fab!(:form_template_2) { Fabricate(:form_template) }
fab!(:form_template_3) { Fabricate(:form_template) }
context "when logged in as a user" do
before { sign_in(user) }
@ -20,10 +20,10 @@ RSpec.describe FormTemplatesController do
expect(json["form_templates"]).to be_present
expect(json["form_templates"].length).to eq(3)
templates = json["form_templates"]
expect(templates[0]["id"]).to eq(form_template_2.id)
expect(templates[1]["id"]).to eq(form_template.id)
expect(templates[2]["id"]).to eq(form_template_3.id)
templates = json["form_templates"].map { |template| template["id"] }
form_templates = [form_template, form_template_2, form_template_3].sort_by(&:id).map(&:id)
expect(templates).to eq(form_templates)
end
end