I'm trying to make a Hobo app with a REST api and test it with RSpec with 
FactoryGirl fixtures.

my user fields look like:
  fields do
    name          :string, :required, :unique
    email_address :email_address, :login => true
    administrator :boolean, :default => false
    api_key       :string, :default=>""
    timestamps
  end

And I have a user factory which looks like:

FactoryGirl.define do
  factory :user do 
    name "Joe Blow"
    email_address "[email protected]"
    administrator false
    api_key "nil value"
  end
end

Right at the start of my first spec file I do

  let(:user) {  FactoryGirl.create(:user) }


And the failure I get is:

  Failure/Error: let(:user) {  FactoryGirl.create(:user) }
     NoMethodError:
       undefined method `api_key=' for #<User:0x00000103ccf098>

In development mode, the api_key can be populated (by an observer)
and generally works as expected.

Can anyone please give me a hint why this is an unknown attribute when
trying to run rspec?

Thanks in advance.

Mike K




-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/3VbGYvuI1rMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to