#new without any parameters

This commit is contained in:
Dylan Knutson
2025-07-18 17:41:23 +00:00
parent 5f502b4f6f
commit 5cdede91ec
2 changed files with 19 additions and 4 deletions

View File

@@ -51,6 +51,16 @@ RSpec.describe HasAuxTable do
end
end
it "can be created with .new" do
car = Car.new
car.name = "Honda Civic"
car.engine_size = 1.8
car.save!
expect(car.fuel_type).to be_nil
expect(car.engine_size).to eq(1.8)
expect(car.name).to eq("Honda Civic")
end
it "has the right #attributes" do
car =
Car.create!(name: "Honda Civic", fuel_type: "gasoline", engine_size: 2.0)