Cucumber issues #7

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

3 participants

@metasoarous

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

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

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

@metasoarous

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

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

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