hpi-swt2 / workshop-portal

A Ruby on Rails app to manage workshops
http://workshopportal.herokuapp.com/
MIT License
21 stars 13 forks source link

refactor application letter factory #634

Closed aloeser closed 7 years ago

aloeser commented 7 years ago

we now use traits instead of inheritance

aloeser commented 7 years ago

One thing I'm not sure about is whether to put the traits into or below the factories, like

factory :application_letter do

    trait :accepted do
          status :acccepted
    end
end

trait :rejected do
    status :rejected
end

Any comments or ideas?

aloeser commented 7 years ago

Nevermind, 1min debugging with rails console helped. Putting them below factories makes them globally available, so that you can run FactoryGirl.build(:event, :accepted) which doesnt make sense. I'll change it soon