Blog

Procedure for Cucumber Testing With Factory Girl

Cucumber is a tool written in the Ruby programming language,for running automated acceptance tests written in a Behavior Driven Development (BDD) style.This video is intended to test  a sample Ruby application with cucumber using a Factory Girl. Below the video, I have listed the high level steps that were followed in the video.

[youtube=https://www.youtube.com/watch?v=ClfkVaMtW2A&w=600 &h=400]
  • Create A file with manage_posts.feature for testing the application.
  • Write the scenarios for testing the application, that you had developed
  • Create posts_steps.rb file in step_definitions folder and we need to write the definitions  which is given by cucumber
  • In posts_steps.rb we used the user with the help of Factory Girl.So we will create a user in the support folder.
  • In the support folder we will write the factory girls steps in factories.rb
  • If the scenarios are passed, that means your developed code is correct or else you need to recheck your code.

This illustrated video was created by Ranjith Immani, Software Engineer and Ruby on Rails Developer at Amzur Technologies