-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Forward given filter block to matcher #2617
Forward given filter block to matcher #2617
Conversation
Sorry for the delay, this will be looked at/considered this coming weekend |
I don't think the tests added are actually validating the filter blocks are run since the |
You're right. When writing the tests, I knew that some of them were not actually accurate as they would pass with or without the block. This one for instance will happily pass with or without the block: expect(page).to have_selector(:css, 'input#test_field') { |input| input.value == 'monkey' } Contrary to this one which would not pass without the block: expect(page).to have_no_selector(:css, 'input#test_field') { |input| input.value == 'not a monkey' } How should the tests be formulated then? I saw in expect { expect(page).to have_selector(:css, 'input#test_field') { |input| input.value == 'not a monkey' } }
.to raise_exception(RSpec::Expectations::ExpectationNotMetError) Would it be better? Any other suggestions? |
Either that or changing the tests to consider number of matched elements like
which would be easier to read/understand |
|
Merged via cacd032 |
Thanks @twalpole for merging. I'm still feeling bad about the tests. Do you mind if I open another PR to provide better tests with |
@cbliard I had already fixed the tests |
* Use updated capybara filter_block syntax teamcapybara/capybara#2617 changed how blocks are evaluated. Thanks to @maxkadel for finding this change! * rubocop -a * ViewComponent 3 compatibility: don't call i18n methods in a component initializer This is due to this upstream PR: ViewComponent/view_component#1666
* Use updated capybara filter_block syntax teamcapybara/capybara#2617 changed how blocks are evaluated. Thanks to @maxkadel for finding this change! * rubocop -a * ViewComponent 3 compatibility: don't call i18n methods in a component initializer This is due to this upstream PR: ViewComponent/view_component#1666
* Use updated capybara filter_block syntax teamcapybara/capybara#2617 changed how blocks are evaluated. Thanks to @maxkadel for finding this change! * rubocop -a * ViewComponent 3 compatibility: don't call i18n methods in a component initializer This is due to this upstream PR: ViewComponent/view_component#1666
* Use updated capybara filter_block syntax teamcapybara/capybara#2617 changed how blocks are evaluated. Thanks to @maxkadel for finding this change! * rubocop -a * ViewComponent 3 compatibility: don't call i18n methods in a component initializer This is due to this upstream PR: ViewComponent/view_component#1666
Fixes #2616