Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FactoryGirl LT

FactoryGirl LT

murajun1978

July 28, 2014
Tweet

More Decks by murajun1978

Other Decks in Programming

Transcript

  1. FactoryGirl
    Getting Started Guide

    View full-size slide

  2. WHO
    @murajun1978
    ΉΒ͡ΎΜ

    View full-size slide

  3. FactoryGirl࢖ͬͯΔʁ

    View full-size slide

  4. fixtures͕͋Δ΍Μ

    View full-size slide

  5. 100ਓͷςετϢʔβΛ࡞੒
    ͯ͠ΈΑ͏ʂ

    View full-size slide

  6. seed
    :
    99ߦॻ͍͍ͯͩ͘͞
    fixtures
    :
    99ߦॻ͍͍ͯͩ͘͞

    View full-size slide

  7. FactoryGirl
    ͜Ε͚ͩʂ

    View full-size slide

  8. 100ճ܁Γฦ͚ͩ͢Ͱ
    ಉ໊͡લ΍Μ

    View full-size slide

  9. Faker͕͋Δ΍Μ
    Gimei͕͋Δ΍Μ

    View full-size slide

  10. FactoryGirlΛ࢖͍͜ͳ͢ᶃ

    View full-size slide

  11. adminϢʔβΛ࡞Δ

    View full-size slide

  12. FactoryGirlΛ࢖͍͜ͳ͢ᶄ
    ͜Ε͚ͩʂ

    View full-size slide

  13. ͍ΖΜͳ૊Έ߹ΘͤΛ࡞Δ

    View full-size slide

  14. FactoryGirlΛ࢖͍͜ͳ͢ᶅ
    ͲͬͪͰ΋͓̺ʂ

    View full-size slide

  15. has_secure_password
    !
    ύεϫʔυΛઃఆ͢Δ

    View full-size slide

  16. FactoryGirlΛ࢖͍͜ͳ͢ᶆ

    View full-size slide

  17. ؔ࿈σʔλ΋Ұॹʹ࡞Δ

    View full-size slide

  18. FactoryGirlΛ࢖͍͜ͳ͢ᶇ

    View full-size slide

  19. DBΞΫηε͕ଟൃ͠
    ςετ͕஗͘ͳͬͯ͘Δ

    View full-size slide

  20. FactoryGirlΛ࢖͍͜ͳ͢ᶈ
    DBʹొ࿥͞Εͳ͍͚Ͳɺ
    ͪΌΜͱIDΛൃߦͯ͘͠ΕΔ

    View full-size slide

  21. FactoryGirlΛ࢖͍͜ͳ͢ᶉ
    ͜ΕΛ௥Ճ

    View full-size slide

  22. ίϐʔ͸ָͪΜͩΑͶ
    Ͱ΋͞ɻɻɻ

    View full-size slide

  23. Don't Repeat Yourself!

    View full-size slide

  24. ͪͳΈʹ
    seedͰ΋require͢Ε͹FactoryGirl
    ͕࢖͑·͢Α( Ŗ`дŖ´)ŝžŕ

    View full-size slide

  25. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

    View full-size slide