I've changed the name of a column in my database and have changed spec/factories.rb
accordingly, however when I run my rspec
tests, it's still trying to make use of the old column names. I've restarted the Ruby on Rails server, yet that doesn't fix it.
# Changed :height to :height_feet
# Added :height_inches
FactoryGirl.define do
factory :user do
...
height 180
end
end
# Changed to:
FactoryGirl.define do
factory :user do
...
height_feet 5
height_inches 11
end
end
Yet when I run rspec spec/models
the following line:
let(:user) { FactoryGirl.create(:user) }
produces the following error:
Failure/Error: let(:user) { FactoryGirl.create(:user) }
NoMethodError:
undefined method `height' for #<User:0x0000000532fc08>
Any thoughts on how I can fix this?