How we integrated Cucumber to Redmine Backlogs
I wanted to know if how we did this is the right way to go. I always preferred using BDD and plain text stories when testing Redmine Backlogs and I finally got around to doing that over the past couple of days. What we did was create a symbolic link in REDMINE_ROOT/features that points to vendor/plugins/redmine_backlogs/features.
Here are the steps we took (not yet fully tested outside Mac OS X): http://github.com/relaxdiego/redmine_backlogs_docs/wiki/development_cucumber
And here's the temporary branch in github with our cucumber tests: http://github.com/relaxdiego/redmine_backlogs/tree/cucumber
It's working really well in my local machine and I'm loving the green-as-a-cuke goodness I've been getting all week. It's addicting! Do you guys have a similar setup as we do? I'd love to know how you guys do BDD with your plugins.
I used cucumber with a few of my plugins but I'm removing it now. I found it to be a waste of time maintaining: the Redmine core's Test::Unit suite, each plugin's Test::Unit suite, and then a separate cucumber suite. Now I'm using plain Rails integration tests, shoulda, and webrat. It's very easy to setup, I can share test helpers, and it still provides full stack tests.
My Kanban plugin used to have some cucumber features if you want to go through it's code. Most of the rake and environment setup is handled by my redmine_plugin_support gem and it didn't require any symlinks to run the tests.
Thanks Eric. I guess it doesn't make sense to use Cucumber for Redmine core considering that it already has an extensive testing framework built on top of Test::Unit. However, for a new project like Redmine Backlogs with no testing to begin with, I thought that going the Cucumber route made sense. The other reasons I chose Cucumber is that I liked the plain text stories (clean and easy to read through) and it can make use of a number of other tools such as shoulda, webrat, etc.
I missed readmine_plugin_support when I started writing this. Thanks for the reminder! I will definitely have a look at it.
Mark M wrote:
However, for a new project like Redmine Backlogs with no testing to begin with, I thought that going the Cucumber route made sense.
Even for my new plugins, I try to use the same test suite as the Redmine core. Plugins load the core's test_helper.rb, so any helpers added to the core can be used by plugins.
Good to hear you are testing your plugin though, good luck.
Hmmm...that makes sense. I should look into that. Thanks!