Last active
December 18, 2015 12:59
-
-
Save skamithi/5787184 to your computer and use it in GitHub Desktop.
capybara 2.0 test for element not visible for either cucumber or rspec feature tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context 'my element' do | |
before do | |
a =<< EOF | |
jQuery -> | |
$('body').append('<div id=empty_or_hidden_element></div>') | |
EOF | |
page.execute_script CoffeeScript.compile(a) | |
end | |
it 'should not be displayed' do | |
lambda { find('#empty_or_hidden_element') }.should raise_error(Capybara::ElementNotFound) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment