Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

JavaScript database strategies should take options #192

Closed
tomstuart opened this Issue · 8 comments

5 participants

Tom Stuart Matt Wynne mipearson Thomas Walpole Kosmas Chatzimichalis
Tom Stuart

If the (non-JavaScript) DatabaseCleaner strategy needs to be set to, say,

DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}

then there's no way to provide the :except => %w[widgets] option when setting Cucumber::Rails::Database.javascript_strategy to :truncation.

Matt Wynne
Owner

Would you like some help providing a patch?

mipearson

I just blew two hours on this to find out that this isn't supported.

The documentation example in the generated env.rb implies that options are honoured. Investigating the source, and then finding this issue, shows that it does not.

Please fix. I would do so myself, but I feel that I've already wasted enough time as the result of incorrect documentation.

mipearson

PR to adjust documentation in Issue #194.

Matt Wynne
Owner

@mipearson thanks for the docs patch and sorry about your wasted hours. Why not make capitalize on what you've learned and make a patch that fixes it? :)

Thomas Walpole

I submitted a pull request that should allow for options to be passed to the strategy

mipearson

Shouldn't it be using the DatabaseCleaner strategy already set rather than overriding it?

Is that possible with the current implementation?

Thomas Walpole

The current cucumber-rails implentation defaults to :truncation for the javascript strategy since one would normally be using :transaction for non javascript tests and that cant be used for javascript tests normally - the change I submitted allows you to pass options (:except, :only ... ) to the javascript strategy to enable handling of things like preloaded static data in the database which you wouldnt want cleared

Kosmas Chatzimichalis
Owner

Closing old issues. If they are still relevant, please reopen

Kosmas Chatzimichalis Kosmas closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.