attempted_record and Cucumber #171

Open
tomekw opened this Issue Sep 8, 2010 · 0 comments

Comments

Projects
None yet
1 participant

tomekw commented Sep 8, 2010

I wanted to validate UserSession to only permit users with status "enabled" to sign in.

In user_session.rb:

validate :check_if_enabled

private
def check_if_enabled
errors.add(:base, 'You are not allowed to sign in') unless attempted_record && attempted_record.enabled?

end

In unit test everything is working fine (UserSession for disabled user is invalid), in Click Driven Development only enabled users can sign in, but when I am trying to run Cucumber scenario use is able to sign in (attempted_record is always nil).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment