@javascript tag is not working with cucumber and Rails 3

199 views
Skip to first unread message

Nadal

unread,
Sep 14, 2010, 9:53:09 AM9/14/10
to Cukes
I am using Rails 3. All my cucumber tests are passing. However if I
add @javascript to one of the test and if I run following command

bundle exec cucumber -p javascript

Then I am getting following error.

Using the javascript profile...

Feature: authentication
@javascript
Scenario: test login # features/
auth.feature:4
uninitialized constant DatabaseCleaner (NameError)

Here is my cucumber.yml

<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format
#{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format
#{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict
--tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --
tags ~@wip
javascript: --tags @javascript


Here is my Gemfile

source 'http://rubygems.org'

gem 'rails', '3.0.0'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'ruby-debug'
gem 'capistrano'
gem 'will_paginate', :git => 'git://github.com/mislav/
will_paginate.git', :branch => 'rails3'
gem 'faker'

group :development, :test do
gem 'shoulda'
gem "rspec-rails", ">= 2.0.0.beta.22"
gem "cucumber-rails", ">= 0.3.2"
gem "capybara"
gem "launchy"
end


As I mentioned with the default profile all the tests are passing.
This problem happens only when I pass -p javascript

ssmithstone

unread,
Oct 2, 2010, 3:59:40 AM10/2/10
to Cukes
try adding database_cleaner to the group

mennomenno

unread,
Oct 2, 2010, 4:26:08 AM10/2/10
to Cukes
On Oct 2, 9:59 am, ssmithstone <stephen.smithst...@gmail.com> wrote:
> try adding database_cleaner to the group

And vote for the issue ;-)

http://github.com/aslakhellesoy/cucumber-rails/issuesearch?state=open&q=database#issue/36
Reply all
Reply to author
Forward
0 new messages