From a6ade8f60872b982ef7dffa46a63a6f1b5f45429 Mon Sep 17 00:00:00 2001 From: simukappu Date: Sat, 5 May 2018 12:16:09 +0900 Subject: [PATCH] Allow Rails 5.2 --- Gemfile.lock | 114 ++++++------ activity_notification.gemspec | 4 +- gemfiles/Gemfile.rails-4.2.lock | 28 +-- gemfiles/Gemfile.rails-5.0.lock | 32 ++-- gemfiles/Gemfile.rails-5.1.lock | 34 ++-- gemfiles/Gemfile.rails-5.2 | 18 ++ gemfiles/Gemfile.rails-5.2.lock | 242 ++++++++++++++++++++++++++ spec/concerns/models/target_spec.rb | 38 +--- spec/rails_app/config/application.rb | 3 + spec/roles/acts_as_notifiable_spec.rb | 26 +-- 10 files changed, 393 insertions(+), 146 deletions(-) create mode 100644 gemfiles/Gemfile.rails-5.2 create mode 100644 gemfiles/Gemfile.rails-5.2.lock diff --git a/Gemfile.lock b/Gemfile.lock index d2c2284c..6e1921be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,44 +4,48 @@ PATH activity_notification (1.4.4) i18n (>= 0.5.0) jquery-rails (>= 3.1.1) - railties (>= 4.2.0, < 5.2) + railties (>= 4.2.0, < 5.3) GEM remote: https://rubygems.org/ specs: - actioncable (5.1.6) - actionpack (= 5.1.6) + actioncable (5.2.0) + actionpack (= 5.2.0) nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) + websocket-driver (>= 0.6.1) + actionmailer (5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.6) - actionview (= 5.1.6) - activesupport (= 5.1.6) + actionpack (5.2.0) + actionview (= 5.2.0) + activesupport (= 5.2.0) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.6) - activesupport (= 5.1.6) + actionview (5.2.0) + activesupport (= 5.2.0) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.6) - activesupport (= 5.1.6) + activejob (5.2.0) + activesupport (= 5.2.0) globalid (>= 0.3.6) - activemodel (5.1.6) - activesupport (= 5.1.6) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) - arel (~> 8.0) - activesupport (5.1.6) + activemodel (5.2.0) + activesupport (= 5.2.0) + activerecord (5.2.0) + activemodel (= 5.2.0) + activesupport (= 5.2.0) + arel (>= 9.0) + activestorage (5.2.0) + actionpack (= 5.2.0) + activerecord (= 5.2.0) + marcel (~> 0.3.1) + activesupport (5.2.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -50,9 +54,9 @@ GEM activesupport (>= 3.0) railties (>= 3.0) rspec-rails (>= 2.2) - arel (8.0.0) - aws-partitions (1.76.0) - aws-sdk-core (3.18.1) + arel (9.0.0) + aws-partitions (1.83.0) + aws-sdk-core (3.20.2) aws-partitions (~> 1.0) aws-sigv4 (~> 1.0) jmespath (~> 1.0) @@ -73,7 +77,7 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.4) tins (~> 1.6) - crass (1.0.3) + crass (1.0.4) devise (4.4.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -82,10 +86,10 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) - dotenv (2.2.1) - dotenv-rails (2.2.1) - dotenv (= 2.2.1) - railties (>= 3.2, < 5.2) + dotenv (2.4.0) + dotenv-rails (2.4.0) + dotenv (= 2.4.0) + railties (>= 3.2, < 6.0) erubi (1.7.1) factory_bot (4.8.2) activesupport (>= 3.0.0) @@ -94,10 +98,10 @@ GEM railties (>= 3.0.0) globalid (0.4.1) activesupport (>= 4.2.0) - i18n (1.0.0) + i18n (1.0.1) concurrent-ruby (~> 1.0) - jmespath (1.3.1) - jquery-rails (4.3.1) + jmespath (1.4.0) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -107,35 +111,39 @@ GEM nokogiri (>= 1.5.9) mail (2.7.0) mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) method_source (0.9.0) + mimemagic (0.3.2) mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.3) - mongo (2.5.1) + mongo (2.5.3) bson (>= 4.3.0, < 5.0.0) - mongoid (7.0.0) + mongoid (7.0.1) activemodel (>= 5.1, < 6.0.0) mongo (>= 2.5.1, < 3.0.0) - mysql2 (0.5.0) - nio4r (2.3.0) + mysql2 (0.5.1) + nio4r (2.3.1) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) orm_adapter (0.5.0) pg (1.0.0) - rack (2.0.4) + rack (2.0.5) rack-test (1.0.0) rack (>= 1.0, < 3) - rails (5.1.6) - actioncable (= 5.1.6) - actionmailer (= 5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - activemodel (= 5.1.6) - activerecord (= 5.1.6) - activesupport (= 5.1.6) + rails (5.2.0) + actioncable (= 5.2.0) + actionmailer (= 5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + activemodel (= 5.2.0) + activerecord (= 5.2.0) + activestorage (= 5.2.0) + activesupport (= 5.2.0) bundler (>= 1.3.0) - railties (= 5.1.6) + railties (= 5.2.0) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -146,9 +154,9 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (5.1.6) - actionpack (= 5.1.6) - activesupport (= 5.1.6) + railties (5.2.0) + actionpack (= 5.2.0) + activesupport (= 5.2.0) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -198,7 +206,7 @@ GEM uniform_notifier (1.11.0) warden (1.2.7) rack (>= 1.0) - websocket-driver (0.6.5) + websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) yard (0.9.12) @@ -218,7 +226,7 @@ DEPENDENCIES dotenv-rails factory_bot_rails (~> 4.8.2) mongoid (>= 4.0.0) - mysql2 (~> 0.5.0) + mysql2 (~> 0.5.1) pg (~> 1.0.0) rails (~> 5.1) rails-controller-testing diff --git a/activity_notification.gemspec b/activity_notification.gemspec index 1ea6bafc..cef665c1 100644 --- a/activity_notification.gemspec +++ b/activity_notification.gemspec @@ -20,12 +20,12 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.required_ruby_version = '>= 2.1.0' - s.add_dependency 'railties', '>= 4.2.0', '< 5.2' + s.add_dependency 'railties', '>= 4.2.0', '< 5.3' s.add_dependency 'i18n', '>= 0.5.0' s.add_dependency 'jquery-rails', '>= 3.1.1' s.add_development_dependency 'sqlite3', '~> 1.3.13' - s.add_development_dependency 'mysql2', '~> 0.5.0' + s.add_development_dependency 'mysql2', '~> 0.5.1' s.add_development_dependency 'pg', '~> 1.0.0' s.add_development_dependency 'mongoid', '>= 4.0.0' s.add_development_dependency 'rspec-rails', '~> 3.7.2' diff --git a/gemfiles/Gemfile.rails-4.2.lock b/gemfiles/Gemfile.rails-4.2.lock index 3803bfd3..fb54a902 100644 --- a/gemfiles/Gemfile.rails-4.2.lock +++ b/gemfiles/Gemfile.rails-4.2.lock @@ -4,7 +4,7 @@ PATH activity_notification (1.4.4) i18n (>= 0.5.0) jquery-rails (>= 3.1.1) - railties (>= 4.2.0, < 5.2) + railties (>= 4.2.0, < 5.3) GEM remote: https://rubygems.org/ @@ -48,8 +48,8 @@ GEM railties (>= 3.0) rspec-rails (>= 2.2) arel (6.0.4) - aws-partitions (1.76.0) - aws-sdk-core (3.18.1) + aws-partitions (1.83.0) + aws-sdk-core (3.20.2) aws-partitions (~> 1.0) aws-sigv4 (~> 1.0) jmespath (~> 1.0) @@ -70,7 +70,7 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.4) tins (~> 1.6) - crass (1.0.3) + crass (1.0.4) devise (4.4.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -79,10 +79,10 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) - dotenv (2.2.1) - dotenv-rails (2.2.1) - dotenv (= 2.2.1) - railties (>= 3.2, < 5.2) + dotenv (2.4.0) + dotenv-rails (2.4.0) + dotenv (= 2.4.0) + railties (>= 3.2, < 6.0) erubis (2.7.0) factory_bot (4.8.2) activesupport (>= 3.0.0) @@ -93,8 +93,8 @@ GEM activesupport (>= 4.2.0) i18n (0.9.5) concurrent-ruby (~> 1.0) - jmespath (1.3.1) - jquery-rails (4.3.1) + jmespath (1.4.0) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -107,11 +107,11 @@ GEM mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.3) - mongo (2.5.1) + mongo (2.5.3) bson (>= 4.3.0, < 5.0.0) - mongoid (5.2.1) + mongoid (5.4.0) activemodel (~> 4.0) - mongo (>= 2.4.1, < 3.0.0) + mongo (>= 2.5.1, < 3.0.0) origin (~> 2.3) tzinfo (>= 0.3.37) mysql2 (0.4.10) @@ -120,7 +120,7 @@ GEM origin (2.3.1) orm_adapter (0.5.0) pg (0.21.0) - rack (1.6.9) + rack (1.6.10) rack-test (0.6.3) rack (>= 1.0) rails (4.2.10) diff --git a/gemfiles/Gemfile.rails-5.0.lock b/gemfiles/Gemfile.rails-5.0.lock index 9d5e2f1e..072ebce9 100644 --- a/gemfiles/Gemfile.rails-5.0.lock +++ b/gemfiles/Gemfile.rails-5.0.lock @@ -4,7 +4,7 @@ PATH activity_notification (1.4.4) i18n (>= 0.5.0) jquery-rails (>= 3.1.1) - railties (>= 4.2.0, < 5.2) + railties (>= 4.2.0, < 5.3) GEM remote: https://rubygems.org/ @@ -51,8 +51,8 @@ GEM railties (>= 3.0) rspec-rails (>= 2.2) arel (7.1.4) - aws-partitions (1.76.0) - aws-sdk-core (3.18.1) + aws-partitions (1.83.0) + aws-sdk-core (3.20.2) aws-partitions (~> 1.0) aws-sigv4 (~> 1.0) jmespath (~> 1.0) @@ -73,7 +73,7 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.4) tins (~> 1.6) - crass (1.0.3) + crass (1.0.4) devise (4.4.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -82,10 +82,10 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) - dotenv (2.2.1) - dotenv-rails (2.2.1) - dotenv (= 2.2.1) - railties (>= 3.2, < 5.2) + dotenv (2.4.0) + dotenv-rails (2.4.0) + dotenv (= 2.4.0) + railties (>= 3.2, < 6.0) erubis (2.7.0) factory_bot (4.8.2) activesupport (>= 3.0.0) @@ -94,10 +94,10 @@ GEM railties (>= 3.0.0) globalid (0.4.1) activesupport (>= 4.2.0) - i18n (1.0.0) + i18n (1.0.1) concurrent-ruby (~> 1.0) - jmespath (1.3.1) - jquery-rails (4.3.1) + jmespath (1.4.0) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -111,18 +111,18 @@ GEM mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.3) - mongo (2.5.1) + mongo (2.5.3) bson (>= 4.3.0, < 5.0.0) mongoid (6.1.1) activemodel (~> 5.0) mongo (>= 2.4.1, < 3.0.0) - mysql2 (0.5.0) - nio4r (2.3.0) + mysql2 (0.5.1) + nio4r (2.3.1) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) orm_adapter (0.5.0) pg (1.0.0) - rack (2.0.4) + rack (2.0.5) rack-test (0.6.3) rack (>= 1.0) rails (5.0.7) @@ -218,7 +218,7 @@ DEPENDENCIES dotenv-rails factory_bot_rails (~> 4.8.2) mongoid (>= 4.0.0) - mysql2 (~> 0.5.0) + mysql2 (~> 0.5.1) pg (~> 1.0.0) rails (~> 5.0.0) rails-controller-testing diff --git a/gemfiles/Gemfile.rails-5.1.lock b/gemfiles/Gemfile.rails-5.1.lock index 63b4b7fc..ca00cd35 100644 --- a/gemfiles/Gemfile.rails-5.1.lock +++ b/gemfiles/Gemfile.rails-5.1.lock @@ -4,7 +4,7 @@ PATH activity_notification (1.4.4) i18n (>= 0.5.0) jquery-rails (>= 3.1.1) - railties (>= 4.2.0, < 5.2) + railties (>= 4.2.0, < 5.3) GEM remote: https://rubygems.org/ @@ -51,8 +51,8 @@ GEM railties (>= 3.0) rspec-rails (>= 2.2) arel (8.0.0) - aws-partitions (1.76.0) - aws-sdk-core (3.18.1) + aws-partitions (1.83.0) + aws-sdk-core (3.20.2) aws-partitions (~> 1.0) aws-sigv4 (~> 1.0) jmespath (~> 1.0) @@ -73,7 +73,7 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.4) tins (~> 1.6) - crass (1.0.3) + crass (1.0.4) devise (4.4.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -82,10 +82,10 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) - dotenv (2.2.1) - dotenv-rails (2.2.1) - dotenv (= 2.2.1) - railties (>= 3.2, < 5.2) + dotenv (2.4.0) + dotenv-rails (2.4.0) + dotenv (= 2.4.0) + railties (>= 3.2, < 6.0) erubi (1.7.1) factory_bot (4.8.2) activesupport (>= 3.0.0) @@ -94,10 +94,10 @@ GEM railties (>= 3.0.0) globalid (0.4.1) activesupport (>= 4.2.0) - i18n (1.0.0) + i18n (1.0.1) concurrent-ruby (~> 1.0) - jmespath (1.3.1) - jquery-rails (4.3.1) + jmespath (1.4.0) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -111,18 +111,18 @@ GEM mini_mime (1.0.0) mini_portile2 (2.3.0) minitest (5.11.3) - mongo (2.5.1) + mongo (2.5.3) bson (>= 4.3.0, < 5.0.0) - mongoid (7.0.0) + mongoid (7.0.1) activemodel (>= 5.1, < 6.0.0) mongo (>= 2.5.1, < 3.0.0) - mysql2 (0.5.0) - nio4r (2.3.0) + mysql2 (0.5.1) + nio4r (2.3.1) nokogiri (1.8.2) mini_portile2 (~> 2.3.0) orm_adapter (0.5.0) pg (1.0.0) - rack (2.0.4) + rack (2.0.5) rack-test (1.0.0) rack (>= 1.0, < 3) rails (5.1.6) @@ -218,7 +218,7 @@ DEPENDENCIES dotenv-rails factory_bot_rails (~> 4.8.2) mongoid (>= 4.0.0) - mysql2 (~> 0.5.0) + mysql2 (~> 0.5.1) pg (~> 1.0.0) rails (~> 5.1.0) rails-controller-testing diff --git a/gemfiles/Gemfile.rails-5.2 b/gemfiles/Gemfile.rails-5.2 new file mode 100644 index 00000000..c48417ee --- /dev/null +++ b/gemfiles/Gemfile.rails-5.2 @@ -0,0 +1,18 @@ +source 'https://rubygems.org' + +gemspec path: '../' + +gem 'rails', '~> 5.2.0' + +group :development do + gem 'bullet' +end + +group :test do + gem 'rails-controller-testing' + gem 'ammeter' + gem 'timecop' + gem 'coveralls', require: false +end + +gem 'dotenv-rails', groups: [:development, :test] diff --git a/gemfiles/Gemfile.rails-5.2.lock b/gemfiles/Gemfile.rails-5.2.lock new file mode 100644 index 00000000..114f2fc4 --- /dev/null +++ b/gemfiles/Gemfile.rails-5.2.lock @@ -0,0 +1,242 @@ +PATH + remote: .. + specs: + activity_notification (1.4.4) + i18n (>= 0.5.0) + jquery-rails (>= 3.1.1) + railties (>= 4.2.0, < 5.3) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.0) + actionpack (= 5.2.0) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.0) + actionview (= 5.2.0) + activesupport (= 5.2.0) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.0) + activesupport (= 5.2.0) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.0) + activesupport (= 5.2.0) + globalid (>= 0.3.6) + activemodel (5.2.0) + activesupport (= 5.2.0) + activerecord (5.2.0) + activemodel (= 5.2.0) + activesupport (= 5.2.0) + arel (>= 9.0) + activestorage (5.2.0) + actionpack (= 5.2.0) + activerecord (= 5.2.0) + marcel (~> 0.3.1) + activesupport (5.2.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + ammeter (1.1.4) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-rails (>= 2.2) + arel (9.0.0) + aws-partitions (1.83.0) + aws-sdk-core (3.20.2) + aws-partitions (~> 1.0) + aws-sigv4 (~> 1.0) + jmespath (~> 1.0) + aws-sdk-sns (1.1.0) + aws-sdk-core (~> 3) + aws-sigv4 (~> 1.0) + aws-sigv4 (1.0.2) + bcrypt (3.1.11) + bson (4.3.0) + builder (3.2.3) + bullet (5.7.5) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.11.0) + concurrent-ruby (1.0.5) + coveralls (0.8.21) + json (>= 1.8, < 3) + simplecov (~> 0.14.1) + term-ansicolor (~> 1.3) + thor (~> 0.19.4) + tins (~> 1.6) + crass (1.0.4) + devise (4.4.3) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 6.0) + responders + warden (~> 1.2.3) + diff-lcs (1.3) + docile (1.1.5) + dotenv (2.4.0) + dotenv-rails (2.4.0) + dotenv (= 2.4.0) + railties (>= 3.2, < 6.0) + erubi (1.7.1) + factory_bot (4.8.2) + activesupport (>= 3.0.0) + factory_bot_rails (4.8.2) + factory_bot (~> 4.8.2) + railties (>= 3.0.0) + globalid (0.4.1) + activesupport (>= 4.2.0) + i18n (1.0.1) + concurrent-ruby (~> 1.0) + jmespath (1.4.0) + jquery-rails (4.3.3) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.1.0) + loofah (2.2.2) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + marcel (0.3.2) + mimemagic (~> 0.3.2) + method_source (0.9.0) + mimemagic (0.3.2) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + mongo (2.5.3) + bson (>= 4.3.0, < 5.0.0) + mongoid (7.0.1) + activemodel (>= 5.1, < 6.0.0) + mongo (>= 2.5.1, < 3.0.0) + mysql2 (0.5.1) + nio4r (2.3.1) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + orm_adapter (0.5.0) + pg (1.0.0) + rack (2.0.5) + rack-test (1.0.0) + rack (>= 1.0, < 3) + rails (5.2.0) + actioncable (= 5.2.0) + actionmailer (= 5.2.0) + actionpack (= 5.2.0) + actionview (= 5.2.0) + activejob (= 5.2.0) + activemodel (= 5.2.0) + activerecord (= 5.2.0) + activestorage (= 5.2.0) + activesupport (= 5.2.0) + bundler (>= 1.3.0) + railties (= 5.2.0) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.2) + actionpack (~> 5.x, >= 5.0.1) + actionview (~> 5.x, >= 5.0.1) + activesupport (~> 5.x) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.2.0) + actionpack (= 5.2.0) + activesupport (= 5.2.0) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.3.1) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-rails (3.7.2) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.1) + simplecov (0.14.1) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + slack-notifier (2.3.2) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.13) + term-ansicolor (1.6.0) + tins (~> 1.0) + thor (0.19.4) + thread_safe (0.3.6) + timecop (0.9.1) + tins (1.16.3) + tzinfo (1.2.5) + thread_safe (~> 0.1) + uniform_notifier (1.11.0) + warden (1.2.7) + rack (>= 1.0) + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + yard (0.9.12) + yard-activesupport-concern (0.0.1) + yard (>= 0.8) + +PLATFORMS + ruby + +DEPENDENCIES + activity_notification! + ammeter + aws-sdk-sns (~> 1) + bullet + coveralls + devise (~> 4.4.3) + dotenv-rails + factory_bot_rails (~> 4.8.2) + mongoid (>= 4.0.0) + mysql2 (~> 0.5.1) + pg (~> 1.0.0) + rails (~> 5.2.0) + rails-controller-testing + rspec-rails (~> 3.7.2) + simplecov (~> 0) + slack-notifier (>= 1.5.1) + sqlite3 (~> 1.3.13) + timecop + yard (~> 0.9.12) + yard-activesupport-concern (~> 0.0.1) + +BUNDLED WITH + 1.14.6 diff --git a/spec/concerns/models/target_spec.rb b/spec/concerns/models/target_spec.rb index 123a25a3..9e500670 100644 --- a/spec/concerns/models/target_spec.rb +++ b/spec/concerns/models/target_spec.rb @@ -924,18 +924,8 @@ def custom_printable_name end if ActivityNotification.config.orm == :active_record - it "calls with_target, with_notifiable and with_notifier" do - expect(ActiveRecord::Base).to receive(:includes).with(:target) - expect(ActiveRecord::Base).to receive(:includes).with(:notifiable) - expect(ActiveRecord::Base).to receive(:includes).with(:notifier) - test_instance.unopened_notification_index_with_attributes - end - - it "does not call with_group" do - expect(ActiveRecord::Base).to receive(:includes).with(:target) - expect(ActiveRecord::Base).to receive(:includes).with(:notifiable) - expect(ActiveRecord::Base).not_to receive(:includes).with(:group) - expect(ActiveRecord::Base).to receive(:includes).with(:notifier) + it "calls with_target, with_notifiable, with_notifier and does not call with_group" do + expect(ActivityNotification::Notification).to receive_message_chain(:with_target, :with_notifiable, :with_notifier) test_instance.unopened_notification_index_with_attributes end end @@ -950,10 +940,7 @@ def custom_printable_name if ActivityNotification.config.orm == :active_record it "calls with_group" do - expect(ActiveRecord::Base).to receive(:includes).with(:target) - expect(ActiveRecord::Base).to receive(:includes).with(:notifiable) - expect(ActiveRecord::Base).to receive(:includes).with(:group) - expect(ActiveRecord::Base).to receive(:includes).with(:notifier) + expect(ActivityNotification::Notification).to receive_message_chain(:with_target, :with_notifiable, :with_group, :with_notifier) test_instance.unopened_notification_index_with_attributes end end @@ -986,18 +973,8 @@ def custom_printable_name end if ActivityNotification.config.orm == :active_record - it "calls with_target, with_notifiable and with_notifier" do - expect(ActiveRecord::Base).to receive(:includes).with(:target) - expect(ActiveRecord::Base).to receive(:includes).with(:notifiable) - expect(ActiveRecord::Base).to receive(:includes).with(:notifier) - test_instance.opened_notification_index_with_attributes - end - - it "does not call with_group" do - expect(ActiveRecord::Base).to receive(:includes).with(:target) - expect(ActiveRecord::Base).to receive(:includes).with(:notifiable) - expect(ActiveRecord::Base).not_to receive(:includes).with(:group) - expect(ActiveRecord::Base).to receive(:includes).with(:notifier) + it "calls with_target, with_notifiable, with_notifier and does not call with_group" do + expect(ActivityNotification::Notification).to receive_message_chain(:with_target, :with_notifiable, :with_notifier) test_instance.opened_notification_index_with_attributes end end @@ -1012,10 +989,7 @@ def custom_printable_name if ActivityNotification.config.orm == :active_record it "calls with_group" do - expect(ActiveRecord::Base).to receive(:includes).with(:target) - expect(ActiveRecord::Base).to receive(:includes).with(:notifiable) - expect(ActiveRecord::Base).to receive(:includes).with(:group) - expect(ActiveRecord::Base).to receive(:includes).with(:notifier) + expect(ActivityNotification::Notification).to receive_message_chain(:with_target, :with_notifiable, :with_group, :with_notifier) test_instance.opened_notification_index_with_attributes end end diff --git a/spec/rails_app/config/application.rb b/spec/rails_app/config/application.rb index 7268eeeb..cf95465d 100644 --- a/spec/rails_app/config/application.rb +++ b/spec/rails_app/config/application.rb @@ -28,6 +28,9 @@ class Application < Rails::Application if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2 && ENV['AN_TEST_DB'] != 'mongodb' config.active_record.raise_in_transactional_callbacks = true end + if Rails::VERSION::MAJOR >= 5 && Rails::VERSION::MINOR >= 2 && ENV['AN_TEST_DB'] != 'mongodb' + config.active_record.sqlite3.represent_boolean_as_integer = true + end end end diff --git a/spec/roles/acts_as_notifiable_spec.rb b/spec/roles/acts_as_notifiable_spec.rb index ad00a855..0f35e170 100644 --- a/spec/roles/acts_as_notifiable_spec.rb +++ b/spec/roles/acts_as_notifiable_spec.rb @@ -183,6 +183,7 @@ context "with :dependent_notifications option" do before do + dummy_notifiable_class.delete_all @notifiable_1, @notifiable_2, @notifiable_3 = dummy_notifiable_class.create, dummy_notifiable_class.create, dummy_notifiable_class.create @group_owner = create(:notification, target: user_target, notifiable: @notifiable_1, group: @notifiable_1) @group_member = create(:notification, target: user_target, notifiable: @notifiable_2, group: @notifiable_1, group_owner: @group_owner) @@ -205,7 +206,7 @@ it "does not deletes any notifications when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users expect(user_target.notifications.reload.size).to eq(3) - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.reload.size).to eq(3) end end @@ -214,14 +215,14 @@ it "deletes all notifications when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :delete_all expect(user_target.notifications.reload.size).to eq(3) - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.reload.size).to eq(2) expect(@group_member.reload.group_owner?).to be_falsey end it "does not delete notifications of other targets when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :delete_all - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(0) expect(dummy_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(1) end @@ -231,14 +232,14 @@ it "destroies all notifications when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :destroy expect(user_target.notifications.reload.size).to eq(3) - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.reload.size).to eq(2) expect(@group_member.reload.group_owner?).to be_falsey end it "does not destroy notifications of other targets when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :destroy - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(0) expect(dummy_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(1) end @@ -260,7 +261,8 @@ it "can not be deleted when it has generated notifications" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :restrict_with_error expect(user_target.notifications.reload.size).to eq(3) - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(0) + @notifiable_1.destroy + expect(@notifiable_1.destroyed?).to be_falsey end end @@ -268,21 +270,21 @@ it "deletes all notifications and update notification group when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :update_group_and_delete_all expect(user_target.notifications.reload.size).to eq(3) - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.reload.size).to eq(2) expect(@group_member.reload.group_owner?).to be_truthy end it "does not delete notifications of other targets when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :update_group_and_delete_all - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(0) expect(dummy_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(1) end it "does not update notification group when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :update_group_and_delete_all - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(@group_member.reload.group_owner?).to be_truthy expect(@other_target_group_member.reload.group_owner?).to be_falsey end @@ -292,21 +294,21 @@ it "destroies all notifications and update notification group when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :update_group_and_destroy expect(user_target.notifications.reload.size).to eq(3) - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.reload.size).to eq(2) expect(@group_member.reload.group_owner?).to be_truthy end it "does not destroy notifications of other targets when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :update_group_and_destroy - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(user_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(0) expect(dummy_target.notifications.filtered_by_instance(@notifiable_1).count).to eq(1) end it "does not update notification group when notifiable is deleted" do dummy_notifiable_class.acts_as_notifiable :users, dependent_notifications: :update_group_and_destroy - expect { @notifiable_1.destroy }.to change(dummy_notifiable_class, :count).by(-1) + expect { @notifiable_1.destroy }.to change(@notifiable_1, :destroyed?).from(false).to(true) expect(@group_member.reload.group_owner?).to be_truthy expect(@other_target_group_member.reload.group_owner?).to be_falsey end