Reputation: 902
Hi I am using FactoryGirl 4.9.0 w/ Rails 4.2.11. I added a boolean column to a model called Query
like so:
class AddSetLatestResultToQueries < ActiveRecord::Migration
def change
add_column :queries, :latest_result_s3_url_flag, :boolean, null: false, default: false
end
end
This flag works fine and the app itself works fine but when it comes to rspec, FactoryGirl seems to be having trouble acknowledging this new column.
I tried to add it to the factory model like this:
FactoryGirl.define do
factory :query do
latest_result_s3_url_flag false
title 'some title'
latest_body 'SELECT TIMEOFDAY();'
... etc ...
end
But when I run rpsec spec
, I see this error:
NoMethodError:
undefined method `latest_result_s3_url_flag=' for #<Query:0x00007ff6f9108428>
Upvotes: 3
Views: 425