diff --git a/Gemfile.lock b/Gemfile.lock index e931b629980..bdd7a6c5166 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,38 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.6) - actionpack (= 4.2.6) - actionview (= 4.2.6) - activejob (= 4.2.6) + actionmailer (4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.6) - actionview (= 4.2.6) - activesupport (= 4.2.6) + actionpack (4.2.7) + actionview (= 4.2.7) + activesupport (= 4.2.7) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.6) - activesupport (= 4.2.6) + actionview (4.2.7) + activesupport (= 4.2.7) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) active_model_serializers (0.8.3) activemodel (>= 3.0) - activejob (4.2.6) - activesupport (= 4.2.6) + activejob (4.2.7) + activesupport (= 4.2.7) globalid (>= 0.3.0) - activemodel (4.2.6) - activesupport (= 4.2.6) + activemodel (4.2.7) + activesupport (= 4.2.7) builder (~> 3.1) - activerecord (4.2.6) - activemodel (= 4.2.6) - activesupport (= 4.2.6) + activerecord (4.2.7) + activemodel (= 4.2.7) + activesupport (= 4.2.7) arel (~> 6.0) - activesupport (4.2.6) + activesupport (4.2.7) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -162,7 +162,7 @@ GEM rack (>= 1.1.3) metaclass (0.0.4) method_source (0.8.2) - mime-types (2.99.1) + mime-types (2.99.2) mini_portile2 (2.1.0) mini_racer (0.1.3) libv8 (~> 5.0) @@ -250,16 +250,16 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) - rails (4.2.6) - actionmailer (= 4.2.6) - actionpack (= 4.2.6) - actionview (= 4.2.6) - activejob (= 4.2.6) - activemodel (= 4.2.6) - activerecord (= 4.2.6) - activesupport (= 4.2.6) + rails (4.2.7) + actionmailer (= 4.2.7) + actionpack (= 4.2.7) + actionview (= 4.2.7) + activejob (= 4.2.7) + activemodel (= 4.2.7) + activerecord (= 4.2.7) + activesupport (= 4.2.7) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.6) + railties (= 4.2.7) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) @@ -272,13 +272,13 @@ GEM rails-observers (0.1.2) activemodel (~> 4.0) rails_multisite (1.0.4) - railties (4.2.6) - actionpack (= 4.2.6) - activesupport (= 4.2.6) + railties (4.2.7) + actionpack (= 4.2.7) + activesupport (= 4.2.7) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.16.0) - rake (11.1.2) + rake (11.2.2) rake-compiler (0.9.9) rake rb-fsevent (0.9.7) @@ -371,10 +371,10 @@ GEM spork-rails (4.0.0) rails (>= 3.0.0, < 5) spork (>= 1.0rc0) - sprockets (3.6.0) + sprockets (3.6.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.0.4) + sprockets-rails (3.1.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) diff --git a/spec/services/post_alerter_spec.rb b/spec/services/post_alerter_spec.rb index 495c68c3112..008d7a3f043 100644 --- a/spec/services/post_alerter_spec.rb +++ b/spec/services/post_alerter_spec.rb @@ -82,7 +82,7 @@ describe PostAlerter do post.revise(admin, {raw: 'I made another revision'}) end - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(3) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(3) end end @@ -97,7 +97,7 @@ describe PostAlerter do PostAction.remove_act(evil_trout, post, PostActionType.types[:like]) PostAction.act(evil_trout, post, PostActionType.types[:like]) - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1) end it 'notifies on does not notify when never is selected' do @@ -111,7 +111,7 @@ describe PostAlerter do PostAction.act(evil_trout, post, PostActionType.types[:like]) - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(0) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(0) end it 'notifies on likes correctly' do @@ -124,7 +124,7 @@ describe PostAlerter do PostAction.act(admin, post, PostActionType.types[:like]) # one like - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1) post.user.user_option.update_columns(like_notification_frequency: @@ -132,7 +132,7 @@ describe PostAlerter do admin2 = Fabricate(:admin) PostAction.act(admin2, post, PostActionType.types[:like]) - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1) # adds info to the notification notification = Notification.find_by(post_number: 1, @@ -146,7 +146,7 @@ describe PostAlerter do PostAction.remove_act(evil_trout, post, PostActionType.types[:like]) # rebuilds the missing notification - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1) notification = Notification.find_by(post_number: 1, topic_id: post.topic_id) @@ -168,7 +168,7 @@ describe PostAlerter do end # first happend within the same day, no need to notify - expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(2) + expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(2) end end