Good day, currently i'm struggling with this error.
Failure/Error: FactoryGirl.create(:subscription) NoMethodError: undefined method `attribute_list' for "AdvtCategories":String
i can't find correct solution for this error. what i found was a suggestion that some column is the same name as the class. didn't help my test
describe Subscription do
context "validations" do
#it { should validate_presence_of :category_id }
it do
FactoryGirl.create(:category)
FactoryGirl.create(:subscription)
should validate_uniqueness_of( :category_id).scoped_to(:user_id)
end
# TODO validator :category_should_exist
end
#it { should belong_to(:user) }
#it { should belong_to(:category) }
#specify { Subscription.per_page.should eq(20) }
end
factories:
factory :subscription do
association :category, factory: :category, :class => 'AdvtCategory'
user
end
factory :category do
name "MyString"
alias_name "MyString"
number_of_items 1
type ""
end
UPDATE 1 it's a factory_girl error. solving it
UPDATE 2
it's factory_girl error on create (build passes of course, so db error) updated code