#new without any parameters
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user