-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method 'placeholder' for Turnip::Steps::Module #62
Comments
This is just a guess since I haven't upgraded to 1.0.0 yet but have you tried moving your call to placeholder outside of your steps_for block? |
Yes, that's it. placeholders have to be global. |
thanks works! |
Hi, I'm having the same issue with turnip 1.0.0 : module CompaniesSteps
step ":subject user should have the role :role" do |subject, role|
within "table.members tr.user_#{subject.id}" do
page.should have_content role
end
@company.send("#{role}s").should include subject
end
placeholder :subject do
match /he/ do @user end
match /the user/ do @invited_user end
end
end which produces:
I've tried to move the placeholder to |
It seems that placeholder definitions can not be wrapped into a module, if you remove the module your example should work. At least it does for me :-) Cheers! |
👍 Thanks, it works for me now. Anyway, I expect a lot of naming collisions here, since |
Sorry, I replied too quickly, the error is gone, but now I have another one: @user is |
Dunno how easily that can be achieved but I think it's valuable too. But I guess @jnicklas can comment on that :-) I don't know if custom place holders were meant to return instance variables but yeah, we'll see :-) |
I also prefer the placeholder to be scoped in step or steps_for. |
Me too. |
+1 |
Hey!
looks like our placeholders aren't working with the 1.0.0 release.
we define them with:
then when we load our steps we get the following error:
The text was updated successfully, but these errors were encountered: