Permalink
Browse files

Merge pull request #1234 from gregmolnar/refute

add refute_selector as alias of assert_no_selector
  • Loading branch information...
2 parents d53b4a4 + 316286d commit fbd0ecfc5b342d02f8d0650e88f23ce1ff2af938 @jnicklas jnicklas committed Jan 31, 2014
Showing with 10 additions and 1 deletion.
  1. +2 −0 lib/capybara/node/matchers.rb
  2. +2 −1 lib/capybara/session.rb
  3. +6 −0 lib/capybara/spec/session/assert_selector.rb
@@ -110,6 +110,8 @@ def assert_no_selector(*args)
return true
end
+ alias_method :refute_selector, :assert_no_selector
+
##
#
# Checks if a given XPath expression is on the page or current node.
@@ -34,7 +34,8 @@ class Session
:has_no_field?, :has_checked_field?, :has_unchecked_field?,
:has_no_table?, :has_table?, :unselect, :has_select?, :has_no_select?,
:has_selector?, :has_no_selector?, :click_on, :has_no_checked_field?,
- :has_no_unchecked_field?, :query, :assert_selector, :assert_no_selector
+ :has_no_unchecked_field?, :query, :assert_selector, :assert_no_selector,
+ :refute_selector
]
SESSION_METHODS = [
:body, :html, :source, :current_url, :current_host, :current_path,
@@ -70,6 +70,12 @@
end
end
+Capybara::SpecHelper.spec '#refute_selector' do
+ it "should be an alias of #assert_no_selector" do
+ Capybara::Node::Matchers.instance_method(:refute_selector).should == Capybara::Node::Matchers.instance_method(:assert_no_selector)
+ end
+end
+
Capybara::SpecHelper.spec '#assert_no_selector' do
before do
@session.visit('/with_html')

0 comments on commit fbd0ecf

Please sign in to comment.