[ARVADOS] updated: 145f9bbd75ec7ca507dda5e17a4c756e4d80ab4c
git at public.curoverse.com
git at public.curoverse.com
Sun Feb 8 00:30:01 EST 2015
Summary of changes:
apps/workbench/test/integration/browser_unsupported.rb | 17 +++++++++++++++++
apps/workbench/test/integration_helper.rb | 17 ++++++++++++-----
apps/workbench/test/support/remove_file_api.js | 1 +
3 files changed, 30 insertions(+), 5 deletions(-)
create mode 100644 apps/workbench/test/integration/browser_unsupported.rb
create mode 100644 apps/workbench/test/support/remove_file_api.js
via 145f9bbd75ec7ca507dda5e17a4c756e4d80ab4c (commit)
from 7a71d74c538c37437e65f5d22205c224d0fe9207 (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 145f9bbd75ec7ca507dda5e17a4c756e4d80ab4c
Author: Tom Clegg <tom at curoverse.com>
Date: Sun Feb 8 00:30:43 2015 -0500
4958: Add tests.
diff --git a/apps/workbench/test/integration/browser_unsupported.rb b/apps/workbench/test/integration/browser_unsupported.rb
new file mode 100644
index 0000000..788907d
--- /dev/null
+++ b/apps/workbench/test/integration/browser_unsupported.rb
@@ -0,0 +1,17 @@
+require 'integration_helper'
+
+class BrowserUnsupported < ActionDispatch::IntegrationTest
+ WARNING_FRAGMENT = 'Your web browser is missing some of the features'
+
+ test 'warning if no File API' do
+ Capybara.current_driver = :poltergeist_without_file_api
+ visit '/'
+ assert_text :visible, WARNING_FRAGMENT
+ end
+
+ test 'no warning if File API' do
+ need_javascript
+ visit '/'
+ assert_no_text :visible, WARNING_FRAGMENT
+ end
+end
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index cb07725..ee3882f 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -4,12 +4,19 @@ require 'capybara/poltergeist'
require 'uri'
require 'yaml'
+POLTERGEIST_OPTS = {
+ window_size: [1200, 800],
+ phantomjs_options: ['--ignore-ssl-errors=true'],
+ inspector: true,
+}
+
Capybara.register_driver :poltergeist do |app|
- Capybara::Poltergeist::Driver.new app, {
- window_size: [1200, 800],
- phantomjs_options: ['--ignore-ssl-errors=true'],
- inspector: true,
- }
+ Capybara::Poltergeist::Driver.new app, POLTERGEIST_OPTS
+end
+
+Capybara.register_driver :poltergeist_without_file_api do |app|
+ js = [File.expand_path '../support/remove_file_api.js', __FILE__]
+ Capybara::Poltergeist::Driver.new app, POLTERGEIST_OPTS.merge(extensions: js)
end
module WaitForAjax
diff --git a/apps/workbench/test/support/remove_file_api.js b/apps/workbench/test/support/remove_file_api.js
new file mode 100644
index 0000000..0c64df2
--- /dev/null
+++ b/apps/workbench/test/support/remove_file_api.js
@@ -0,0 +1 @@
+window.FileReader = null;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list