0
나는이 공장을Rails/RSpec/FactoryGirl - 메소드에 필드를 지정하는 방법은 무엇입니까?
FactoryGirl.define do
factory :gst_report do
association :organisation, factory: :active_organisation
period_months 3
period_start_date Date.parse('2015-01-01')
period_end_date Date.parse('2015-02-01')
end
end
을하지만 테스트에서 period_start_date
는 종종 다른 날짜로 설정됩니다. 이 테스트들 각각에 대해 다음 달이되도록 period_end_date
을 간단히 입력하고 싶습니다.
period_end_date
을 현재 period_start_date
으로 가져와 한 달 추가하는 방법은 있습니까?
@XinruiZhu를 편집하여 코드를 수정 해 주셔서 감사합니다! –