mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Cleanup some test output
This commit is contained in:
parent
e145ec5ab7
commit
ddc223cc4d
1 changed files with 4 additions and 8 deletions
|
@ -153,16 +153,12 @@ Capybara::SpecHelper.spec '#has_text?' do
|
||||||
expect(@session).to have_text(42)
|
expect(@session).to have_text(42)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should be true when passed nil' do
|
it 'should be true when passed nil, and warn about it' do
|
||||||
# nil is converted to '' when to_s is invoked
|
# nil is converted to '' when to_s is invoked
|
||||||
@session.visit('/with_html')
|
@session.visit('/with_html')
|
||||||
expect(@session).to have_text(nil)
|
expect do
|
||||||
end
|
expect(@session).to have_text(nil)
|
||||||
|
end.to output(/Checking for expected text of nil is confusing/).to_stderr
|
||||||
it 'should warn when passed nil' do
|
|
||||||
@session.visit('/with_html')
|
|
||||||
expect_any_instance_of(Kernel).to receive(:warn).with(/Checking for expected text of nil is confusing/) # rubocop:disable RSpec/AnyInstance
|
|
||||||
expect(@session).to have_text(nil)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should wait for text to appear', requires: [:js] do
|
it 'should wait for text to appear', requires: [:js] do
|
||||||
|
|
Loading…
Add table
Reference in a new issue