RSpec II
Topics
- RSpec Tools
- FactoryGirl
- Spork
- Guard
- Using Capybara with RSpec
RSpec Tools
RSpec Tools: FactoryGirl
- What is FactoryGirl?
- Factory Girl gem is a replacement of default “fixtures” with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance
- Steps for using FactoryGirl
- Step #1: Install FactoryGirl gem
- Step #2: Create a factory – spec/factories.rb or spec/factories/*.rb
- Step #3: Now you can use FactoryGirl in your spec for creating fixtures
You must have an active subscription to download PDF and Lab Zip of this course topic.Please click the "Subscribe" button or the "Login" button if you already have an account.