Skip to content

Cucumber::Rails::Database.javascript_strategy is too simpleΒ #537

@jherdman

Description

@jherdman

πŸ‘“ What did you see?

When database_cleaner-redis AND database_cleaner-active_record are in play, I cannot correctly configure them for the Cucumber::Rails::Database.javascript_strategy. I'm forced to consolidate upon a single strategy.

βœ… What did you expect to see?

I am able to set the correct strategy for any given database cleaner adapter I'm using.

πŸ“¦ Which tool/library version are you using?

cucumber-rails v2.5.1

πŸ”¬ How could we reproduce it?

Steps to reproduce the behavior:

  1. Set up some Rails app with cucumber-rails, Redis, and database-cleaner with both database_cleaner-active_record and database_cleaner-redis
  2. Add the following to features/support/env.rb:
# Remove/comment out the lines below if your app doesn't have a database.
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
begin
  DatabaseCleaner[:active_record].strategy = :transaction
  DatabaseCleaner[:redis].strategy = :deletion
rescue NameError
  raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end

Before('@javascript') do
  DatabaseCleaner[:redis].strategy = :deletion
end
  1. Run your Cucumber suite
  2. See error:
Using the default profile...
@javascript
Feature: Some feature
  As an...
  I want to...
  So that....

  Background:                                                           # features/something.feature:8
      The 'truncation' strategy does not exist for the redis ORM!  Available strategies: deletion (DatabaseCleaner::UnknownStrategySpecified)

πŸ“š Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions