more rspec

This commit is contained in:
Dylan Knutson
2025-07-15 07:22:38 +00:00
parent 239afcbadb
commit fda95fb33f
7 changed files with 136 additions and 140 deletions

View File

@@ -129,6 +129,16 @@ RSpec.describe HasAuxTable do
expect(Vehicle.count).to eq(0)
end
describe "column reporting" do
it "reports the correct columns on the string repr of the class" do
expect(Car.inspect).to include("fuel_type")
end
it "does not include the aux table foreign key" do
expect(Car.inspect).not_to include("base_table_id")
end
end
describe "database integration" do
it "provides automatic attribute accessors for auxiliary table columns" do
vehicle = Car.create!(name: "Honda Civic")