-
Notifications
You must be signed in to change notification settings - Fork 9
page.must_have_content not working #10
Comments
Can you give me more information on what you are using? Testing gems, minitest version, capybara version, etc.? |
of course :) minitest 5.3.5
|
I'm afraid I've never used cucumber. Just before Do capybara and cucumber normally work in this way without my gem? |
i've got
without your gem i see
|
Sorry for the late reply. Try: |
I've fixed problem with following
Thanks a lot! |
That's not a fix. It's a workaround. This gem is supposed to provide minitest::spec style assertions for Capybara, but it doesn't work in Cucumber. Can we reopen this bug? It applies to me too, and I'm not content with the workaround. |
I can confirm that |
Any chance you could create a repo for me with your environment and a failing test? Would help me a ton to debug. |
Here's the repo of my current project is this ok? or do you want a smaller repo, just enough to reproduce the problem? |
Please, if it's not too much trouble. Would help to isolate the problem. |
OK, when I get some time to do that. |
Here's the repo for a bare rails project with just enough code to produce the bug: run |
@toby-1-kenobi I was able to get it to work, but it's not a good solution. Not sure how long it will last as a "feature". I'm open to suggestions. See toby-1-kenobi/bug-demo#1. |
There are also failing tests. Will look into those when I can. But do let me know if you think the solution is good/bad. |
Why do you think the solution is not good? |
It looks like the the key is having the code
which I put into putting this code into |
I don't particularly like it because it's not intuitive. It's really just a bandaid. I just figured out what was missing from Minitest::Spec's initializer and copied it in the Since you find the solution good enough, I'll add it to the README, but I don't feel like it's good enough to support in the gem itself, even unofficially. |
@ordinaryzelig we apply a workaround by doing the following in require 'minitest/spec'
# ...
# Make minitest assertions available in Cucumber
class MinitestWorld
extend Minitest::Assertions
attr_accessor :assertions
def initialize
self.assertions = 0
end
end
World do
MinitestWorld.new
end Is this more palatable? |
@f3ndot I gave it a shot (still not familiar with cucumber at all). I copied your code into the bug demo above in
I'm assuming you're using plain cucumber, and not cucumber-rails? Either way, I think my main goal is to have the world class somehow run everything that happens in Minitest::Spec's constructor. Currently, the only thing it needs is the Thread snippet, which I've already added to |
Yes, we're using plain cucumber. And fair enough. Hopefully it help Google-searchers in the future 😄 |
Also, there's a note in the readme pointing here. 😄 |
Hi,
on attempt to run following test
i see error
how to fix it?
The text was updated successfully, but these errors were encountered: