I've been meaning to get into testing. After reading about a few testing frameworks (test::unit, Rspec, etc). I've decided give Rspec and Capybara a try.
I'd like to understand how experienced developers utilize these libraries properly. Which in-turn will help me write better application code and find bugs or little errors in the smallest cracks in the application.
Approaching this as a total TDD nooby. What online sources have you come across to help you learn about Rspec + Capybara. I found this Railscast, which is a good starting point. Are there any other sources / articles I should be reading?
I came across The Rspec Book, which is great for Rspec, but touches more on Cucumber examples.
In addition, how can I find out all the functions available for Capybara. i.e. fill_in, click_link, etc. The Github page mentions a few, but not all.
Capybara is a framework which allows us to test the code in our views by filling in form data, inspecting page content and sending HTTP requests to the browser. Let's set up a spec to test our newly created form: rails generate rspec:feature form. This will generate the file spec/features/form_spec.rb .
Capybara is a web-based test automation software that simulates scenarios for user stories and automates web application testing for behavior-driven software development. It is written in the Ruby programming language.
RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly.
I also use Rspec with Capybara, and i get along very well with this references:
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With