Rails RSpec not seeing new model attributes -
Rails RSpec not seeing new model attributes -
i added new attribute booking model through migration.
class addpickuptimeendandpickupdetailstobookings < activerecord::migration def alter add_column :bookings, :pickup_details, :string end end
i adding validation code:
class booking < activerecord::base [...] validates :pickup_details, length: { maximum: 150 }
and booking model specs failing with:
failure/error: create(:booking) nomethoderror: undefined method `pickup_details' #<booking:0x0000006d043e28>
either messed things awfully, either i'm missing obvious...
did run migrations test environment ?
rails_env=test rake db:migrate
ruby-on-rails rspec
Comments
Post a Comment