[ARVADOS] updated: 32ca1dc4da9100a1a698d33a46c2919cf53fe606
git at public.curoverse.com
git at public.curoverse.com
Tue May 6 12:58:28 EDT 2014
Summary of changes:
apps/workbench/test/integration/folders_test.rb | 4 ++--
apps/workbench/test/integration_helper.rb | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
via 32ca1dc4da9100a1a698d33a46c2919cf53fe606 (commit)
from a848b6ea430ee2b2c1daee80e846d4d3bd594920 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 32ca1dc4da9100a1a698d33a46c2919cf53fe606
Author: Tom Clegg <tom at curoverse.com>
Date: Tue May 6 12:58:14 2014 -0400
Add find?() method so "assert find?(...), msg" can be used in test cases.
diff --git a/apps/workbench/test/integration/folders_test.rb b/apps/workbench/test/integration/folders_test.rb
index b39cf24..8752dad 100644
--- a/apps/workbench/test/integration/folders_test.rb
+++ b/apps/workbench/test/integration/folders_test.rb
@@ -20,8 +20,8 @@ class FoldersTest < ActionDispatch::IntegrationTest
page.assert_no_selector '.editable-submit'
end
visit current_path
- # Raise exception if description update did not survive page refresh:
- find '.panel', text: 'I just edited this.'
+ assert(find?('.panel', text: 'I just edited this.'),
+ "Description update did not survive page refresh")
end
test 'Add a new name, then edit it, without creating a duplicate' do
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index 88aec2c..1784779 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -22,4 +22,16 @@ class ActionDispatch::IntegrationTest
q_string = URI.encode_www_form('api_token' => api_token)
"#{path}#{sep}#{q_string}"
end
+
+ # Find a page element, but return false instead of raising an
+ # exception if not found. Use this with assertions to explain that
+ # the error signifies a failed test rather than an unexpected error
+ # during a testing procedure.
+ def find? *args
+ begin
+ find *args
+ rescue Capybara::ElementNotFound
+ false
+ end
+ end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list