RailsApps / rails3-bootstrap-devise-cancan

Outdated. See the rails-devise-pundit example app for Rails 4.1.
http://railsapps.github.io
491 stars 207 forks source link

Fixed a bug where changing the password of the :user factory would cause the Cucumber specs to break. #30

Open bbugh opened 11 years ago

bbugh commented 11 years ago

Changing the default :user password for the factories/users.rb will causes errors, because the user_steps.rb definitions uses it's own default password that only by coincidence is the same as the user factory. This will cause the Cucumber specs to fail.

I changed it to simply load the @visitor hash as options when creating a user. It seems to make more sense anyway since the visitor is used elsewhere. You could also write out the full password: @visitor[:password], password_confirmation: @visitor[:password_confirmation] but that seems clunkier.

A minor bug, but it cost me a few hours of frustration, so hopefully this will save someone else the trouble.