machinist, sham, cucumber and authlogic

33 views
Skip to first unread message

Sebastian

unread,
Oct 22, 2009, 3:37:24 PM10/22/09
to Machinist Users
Ok, it seems to me, that i have a tricky problem with the proper setup
of machinist and sham in a cucumber testing environment to play nicely
with authlogic.

I have tried several ways to get the following to work:

require 'machinist/active_record'
require 'sham'
require 'faker'

Sham.define do
login {Faker::Name.name }
email {Faker::Internet.email }
end

User.blueprint do
login { Sham.login }
email { Sham.email }
password {'loremipsum'}
password_confirmation {'loremipsum'}
end

Every time i call "User.make" inside a cucumber step, it throws a
"stack level to deep" exception on calling the login block inside the
User blueprint. When i call the User blueprint in script/console i
have no problems.

Other blueprints have no problems inside the cucumber environment.

Am i missing something essential? Maybe someone had the same problems
with authlogic?

Pete Yandell

unread,
Oct 28, 2009, 11:34:19 PM10/28/09
to Machinist Users
Can't say I've seen that one before! Do you get a stack trace with the
error, so you can work out where the loop is?

On Oct 23, 6:37 am, Sebastian <korfmann.sebast...@googlemail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages