這是我的課廠即lesson.rbFactoryGirl錯誤 「define_method':沒有嘗試過的塊(引發ArgumentError)創建進程內對象」
FactoryGirl.define do
factory :lesson do |lesson|
lesson.sequence(:title) { |n| "title#{n}" }
lesson.sequence(:description) { |n| "description#{n}" }
lesson.sequence(:transcript) { |n| "transcript#{n}" }
association :course, strategy: :build
end
end
這裏是我的lesson_spec.rb文件
require 'spec_helper'
describe Lesson do
before { let(:lesson) { FactoryGirl.create(:lesson) } }
subject (:lesson)
it { should validate_presence_of :title }
end
任何幫助?提前致謝!!!