From 2f9735062fa34d5430758bd742ae13d648cdc151 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Thu, 31 Aug 2017 10:19:52 -0400 Subject: [PATCH 1/5] Addressing false successes of `to have_content` Related to #1599 Closes #1592 See [Capybara::Maleficent v0.2.0 release notes][v020] for additional details. [v020]:[https://github.com/jeremyf/capybara-maleficent/releases/tag/v0.2.0] --- hyrax.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyrax.gemspec b/hyrax.gemspec index 2f8d6c1763..a4c4a20cd8 100644 --- a/hyrax.gemspec +++ b/hyrax.gemspec @@ -82,7 +82,7 @@ EOF spec.add_development_dependency 'rspec-its', '~> 1.1' spec.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0' spec.add_development_dependency "capybara", '~> 2.4' - spec.add_development_dependency 'capybara-maleficent', '~> 0.1' + spec.add_development_dependency 'capybara-maleficent', '~> 0.2' spec.add_development_dependency "chromedriver-helper" spec.add_development_dependency "selenium-webdriver" spec.add_development_dependency "factory_girl_rails", '~> 4.4' From 82271147a753ce50079e5b73ef255756fd337356 Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Thu, 31 Aug 2017 09:32:29 -0700 Subject: [PATCH 2/5] Restores ability to add existing works to existing collections via dashboard Refs #1191 This is a workaround that restores this functionality. We suspect the bug itself is a regression in Rails or Turbolinks. See #1191 for more analysis. This patch is being put in place to allow the 2.0.0.beta1 release to ship. --- app/views/hyrax/dashboard/collections/_edit_actions.html.erb | 3 ++- app/views/hyrax/dashboard/collections/_show_actions.html.erb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/hyrax/dashboard/collections/_edit_actions.html.erb b/app/views/hyrax/dashboard/collections/_edit_actions.html.erb index 810f6095b3..146e037467 100644 --- a/app/views/hyrax/dashboard/collections/_edit_actions.html.erb +++ b/app/views/hyrax/dashboard/collections/_edit_actions.html.erb @@ -3,5 +3,6 @@ <%= link_to t('hyrax.collection.actions.add_works.label'), hyrax.my_works_path(add_works_to_collection: @form.id), title: t('hyrax.collection.actions.add_works.desc'), - class: 'btn btn-default' %> + class: 'btn btn-default', + data: { turbolinks: false } %> diff --git a/app/views/hyrax/dashboard/collections/_show_actions.html.erb b/app/views/hyrax/dashboard/collections/_show_actions.html.erb index 2fa70b2f11..8649844c31 100644 --- a/app/views/hyrax/dashboard/collections/_show_actions.html.erb +++ b/app/views/hyrax/dashboard/collections/_show_actions.html.erb @@ -8,7 +8,8 @@ <%= link_to t('hyrax.collection.actions.add_works.label'), hyrax.my_works_path(add_works_to_collection: presenter.id), title: t('hyrax.collection.actions.add_works.desc'), - class: 'btn btn-default' %> + class: 'btn btn-default', + data: { turbolinks: false } %> <%end %> <% if can? :destroy, presenter.solr_document %> From cb5d81d91a00aca9ba187ace9019972dbe59e664 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Thu, 31 Aug 2017 15:28:27 -0400 Subject: [PATCH 3/5] Reducing chatter of capybara-maleficent Also enabling skipping the spindle. --- spec/spec_helper.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 52477f6952..e48c29844a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -39,9 +39,19 @@ def coverage_needed? require 'equivalent-xml' require 'equivalent-xml/rspec_matchers' require 'database_cleaner' -# See https://github.com/jeremyf/capybara-maleficent -# Wrap Capybara matchers with sleep intervals to reduce fragility of specs. -require 'capybara/maleficent/spindle' + +unless ENV['SKIP_MALEFICENT'] + # See https://github.com/jeremyf/capybara-maleficent + # Wrap Capybara matchers with sleep intervals to reduce fragility of specs. + require 'capybara/maleficent/spindle' + + Capybara::Maleficent.config do |c| + # Quieting down maleficent's logging + logger = Logger.new(STDOUT) + logger.level = Logger::INFO + c.logger = logger + end +end # Require supporting ruby files from spec/support/ and subdirectories. Note: engine, not Rails.root context. Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each { |f| require f } From 3c25c935d8a495ad6ca75de2fe91fcd4f87136b5 Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Thu, 31 Aug 2017 13:53:52 -0700 Subject: [PATCH 4/5] Update latest Rails 5.0 version in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc474f44fd..b24e6fa7b4 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Hyrax requires Rails 5. We recommend the latest Rails 5.0 release. ``` # If you don't already have Rails at your disposal... -gem install rails -v 5.0.3 +gem install rails -v 5.0.5 ``` ### JavaScript runtime From 1880acfee813fba6ac38d6877f350bab8400a0a0 Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Thu, 31 Aug 2017 13:54:36 -0700 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b24e6fa7b4..835133dfbb 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app. Generate a new Rails application using the template. ``` -rails _5.0.3_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/master/template.rb +rails _5.0.5_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/master/template.rb ``` Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including: