Skip to content

Instantly share code, notes, and snippets.

@harryworld
Last active August 29, 2015 14:08
Show Gist options
  • Save harryworld/aa99e4bb043eff2d3a0f to your computer and use it in GitHub Desktop.
Save harryworld/aa99e4bb043eff2d3a0f to your computer and use it in GitHub Desktop.
BDD 5-min quiz
  1. What kinds of tests can we do in general?
User Acceptance Test
Integration Test
Unit Test
Stress Test
Profiling

  1. To implement Behaviour Driven Development:
  • Which gems did we use? capybara / rspec
  • What does each of those gems do?
    • capybara -> User Acceptance Test
    • rspec -> Unit Test
  1. What is the command to setup the BDD testing environment?
  • rails generate rspec:install
  1. Where do we put the spec files?
  • spec/features
  1. What is the naming convention of the testing files?
  • It should end with spec.rb
  1. What are the reserved keywords used in capybara?
  • How to visit a path? visit root_path
  • How to fill the information to input text field? fill_in 'Name', :with => 'Harry'
  • How to click a submit button? click_button 'Submit'
  • How to check the resulting page to have certain text? expect(page).to have_content 'Whatever'
  • How to check the existence of CSS in the resulting page? expect(page).to have_content 'container'

  1. Now, implement one test case in your own project.
@harryworld
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment