Hello fellow redditors. I have googled for rails bdd tutorials and all i can find is simple hello world examples. I would like to see something deep. Like implementing a whole blog site with cucumber/spinach.
Please share some links or tutorials. I am depending on you. I am stuck on something and frustated searched google to 10 pages and posted here finally.
Hope to find something useful.
1 thought on “Tutorial for BDD with Rails.”
You know, I’ve been using Cucumber to develop Rails apps for a very long time now, and I don’t think that I’ve seen a freely-available tutorial for building a non-trivial Rails app in this manner. There is a good chunk dedicated to the topic in the [Cucumber Book](https://pragprog.com/book/hwcuc/the-cucumber-book), but it’s out of print and kinda outdated by this point.
That said, [here](https://github.com/ess/smart_aleck-rails) is a link to an app that I use that is tested with Cucumber and Rspec.
The best advice that I can give is to get together a set of testing libraries that work the way that you like. For example, my own “test” group tends to look a lot like that from the smart_aleck-rails Gemfile:
group :test do
gem ‘poltergeist’ # phantomjs driver for capybara
gem ‘capybara’ # for testing web interactions
gem ‘cucumber-rails’, require: false # to integrate cucumber with rails easily
gem ‘simplecov’, require: false # because test coverage is a nonsense metric in general, but not if you do it right
gem ‘database_cleaner’ # to clean out my test database between scenarios
gem ’email_spec’ # to ensure that emails get sent with the proper content
gem ‘faker’ # random data helps ensure scenario idempotence
gem ‘factis’ # to safely track specific bits of state between scenario steps
I have a few more bits of general advice, but they’re probably not very helpful. That being the case, what is the specific something that has you stuck right now?