aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/system_testing/test_helpers/assertions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/system_testing/test_helpers/assertions.rb')
-rw-r--r--actionpack/lib/system_testing/test_helpers/assertions.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/actionpack/lib/system_testing/test_helpers/assertions.rb b/actionpack/lib/system_testing/test_helpers/assertions.rb
new file mode 100644
index 0000000000..865b5e59db
--- /dev/null
+++ b/actionpack/lib/system_testing/test_helpers/assertions.rb
@@ -0,0 +1,32 @@
+module SystemTesting
+ module TestHelpers
+ module Assertions
+ def assert_all_of_selectors(*items)
+ options = items.extract_options!
+ type = type_for_selector(items)
+
+ items.each do |item|
+ assert_selector type, item, options
+ end
+ end
+
+ def assert_none_of_selectors(*items)
+ options = items.extract_options!
+ type = type_for_selector(items)
+
+ items.each do |item|
+ assert_no_selector type, item, options
+ end
+ end
+
+ private
+ def type_for_selector(*items)
+ if items.first.is_a?(Symbol)
+ items.shift
+ else
+ Capybara.default_selector
+ end
+ end
+ end
+ end
+end