Configuring database_cleaner

Recently I added few integration tests in my projects using Capybara and Selenium webdriver and ran into banging my head against inconsistencies with test database. I create some records in test DB which were completely invisible to Selenium-driven browser-based tests. The problem is: the tests are being wrapped in database transactions, so any code running outside the actual test process (like, say, a server process servicing a Selenium-driven browser request) does not see the database records. Here are the steps to fix this problem - First of all, and this is very important, go into spec/spec_helper.rb and

Integration Testing

What does Integration testing mean ? Wiki says: Integration testing is the phase in software testing in which individual software modules are combined and tested as a group [Read More][1] When a software grows(may it be written in Ruby or Java or any other language for that matter), stability can become an issue as the application evolve and grow. Integration tests provide a great way to perform end-to-end tests that validate the application is performing as expected. The BDD-TDD life cycle goes as follows: Integration relates more towards BDD, so let's briefly get to know how BDD works. When

Capybara-Webkit : How it works and its anomolies

This post is to explain some insights of [capybara-webkit][1] and its functional setup. What is capybara-webkit ? Capybara-webkit is used for acceptance tests in our rails 3 application and it turned out to be non trivial, even though there are excellent tools out there, and they keep getting better. WebKit is an open source web browser engine and capybara-webkit depends on a WebKit implementation from Qt, a cross-platform development toolkit. Using capybara with the capybara-webkit driver, works great because it runs in headless mode, without annoying browser windows popping up. How to setup ? gem "capybara-webkit" Set javascript driver to webkit

Useful Links on Rspec, Cucumber, Capybara,TDD, BDD

Hello Everyone, I wanted to share few links that Swapnil shared with me in the past. All of the links were really great. So I am sharing it here. Also if possible, just take an hour to go through the links. They are really good. If you guys find any good links other than the ones I give below, please post them as comments.So that this post can help someone who needs good references for the specs in the future. https://github.com/jnicklas/capybara https://gist.github.com/zhengjia/428105 :capybara cheat sheet http://eggsonbread.com/2010/09/