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

FactoryGirl LT

FactoryGirl LT

D8cd979e90361eb5ca5414dd15b35d0f?s=128

murajun1978

July 28, 2014
Tweet

Transcript

  1. FactoryGirl Getting Started Guide

  2. WHO @murajun1978 ΉΒ͡ΎΜ

  3. FactoryGirl࢖ͬͯΔʁ

  4. fixtures͕͋Δ΍Μ

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

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

  7. FactoryGirl ͜Ε͚ͩʂ

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

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

  10. FactoryGirlΛ࢖͍͜ͳ͢ᶃ

  11. adminϢʔβΛ࡞Δ

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

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

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

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

  16. FactoryGirlΛ࢖͍͜ͳ͢ᶆ

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

  18. FactoryGirlΛ࢖͍͜ͳ͢ᶇ

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

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

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

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

  23. Don't Repeat Yourself!

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

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