Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Cucumber issues #7

Open
metasoarous opened this issue Dec 6, 2009 · 4 comments
Open

Cucumber issues #7

metasoarous opened this issue Dec 6, 2009 · 4 comments

Comments

@metasoarous
Copy link

I just set up restful_auth with the cucumber tests on rails 2.3.5 and Ruby 1.9 and found that the user step
Then /^she should +see an? (\w+) message '([\w !']+)'$/ do |notice, message|
response.should have_flash(notice, %r{#{message}})
end

should be

Then /^she should +see an? (\w+) message '([\w !\']+)'$/ do |notice, message|
  response.should have_flash(notice, :content => %r{#{message}})
end

for things to work. Don't know if something changed recently that would have this work before but not now, but it all goes back to the have_flash which depends on have_tag, which in turn (so far as I can tell) looks for content if you send in content through a hash. Perhaps it used to look for any second argument as though it were content, but if so it is doing so wonkily now.

@metasoarous
Copy link
Author

Okay, I goofed here - sending in %r{#{message}} through hash assignment to the :content key doesn't actually work - that effectively just checks whether or not there is a "div.#{notice}" tag somewhere in the returned html. I'm wrestling with a bunch of strange issues and I'll post as I figure more out.

@technoweenie
Copy link
Owner

I don't use cucumber. Send a pull request if you have a fix.

@metasoarous
Copy link
Author

I haven't been messing with restful_auth too much lately, but I started a thread related to the weirdness on railsforum and after some time started getting some more information - (see here). It looks like part of the problem has been solved and could potentially be pretty easily merged in, but it also seems that not everything has been fixed yet.

Even if you are not interested in tracking this down yourself, perhaps you could suggest on that discussion that anyone who fixes some part of the bug can send a pull request. Like I said, I haven't been messing with it lately.

@felixding
Copy link

Finally!
By changing the line to
response.should have_flash(notice, :content => %r{#{message}})
The tests passed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants