mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
parent
56a7249498
commit
4d27d7e1d3
2 changed files with 40 additions and 40 deletions
66
Gemfile.lock
66
Gemfile.lock
|
@ -1,38 +1,38 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.2.7)
|
actionmailer (4.2.6)
|
||||||
actionpack (= 4.2.7)
|
actionpack (= 4.2.6)
|
||||||
actionview (= 4.2.7)
|
actionview (= 4.2.6)
|
||||||
activejob (= 4.2.7)
|
activejob (= 4.2.6)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
actionpack (4.2.7)
|
actionpack (4.2.6)
|
||||||
actionview (= 4.2.7)
|
actionview (= 4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
rack (~> 1.6)
|
rack (~> 1.6)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.2)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (4.2.7)
|
actionview (4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
active_model_serializers (0.8.3)
|
active_model_serializers (0.8.3)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
activejob (4.2.7)
|
activejob (4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.0)
|
||||||
activemodel (4.2.7)
|
activemodel (4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
activerecord (4.2.7)
|
activerecord (4.2.6)
|
||||||
activemodel (= 4.2.7)
|
activemodel (= 4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
arel (~> 6.0)
|
arel (~> 6.0)
|
||||||
activesupport (4.2.7)
|
activesupport (4.2.6)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
|
@ -160,7 +160,7 @@ GEM
|
||||||
rack (>= 1.1.3)
|
rack (>= 1.1.3)
|
||||||
metaclass (0.0.4)
|
metaclass (0.0.4)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (2.99.2)
|
mime-types (2.99.1)
|
||||||
mini_portile2 (2.1.0)
|
mini_portile2 (2.1.0)
|
||||||
mini_racer (0.1.3)
|
mini_racer (0.1.3)
|
||||||
libv8 (~> 5.0)
|
libv8 (~> 5.0)
|
||||||
|
@ -248,16 +248,16 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.2.7)
|
rails (4.2.6)
|
||||||
actionmailer (= 4.2.7)
|
actionmailer (= 4.2.6)
|
||||||
actionpack (= 4.2.7)
|
actionpack (= 4.2.6)
|
||||||
actionview (= 4.2.7)
|
actionview (= 4.2.6)
|
||||||
activejob (= 4.2.7)
|
activejob (= 4.2.6)
|
||||||
activemodel (= 4.2.7)
|
activemodel (= 4.2.6)
|
||||||
activerecord (= 4.2.7)
|
activerecord (= 4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.2.7)
|
railties (= 4.2.6)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
activesupport (>= 4.2.0.alpha)
|
activesupport (>= 4.2.0.alpha)
|
||||||
|
@ -270,13 +270,13 @@ GEM
|
||||||
rails-observers (0.1.2)
|
rails-observers (0.1.2)
|
||||||
activemodel (~> 4.0)
|
activemodel (~> 4.0)
|
||||||
rails_multisite (1.0.4)
|
rails_multisite (1.0.4)
|
||||||
railties (4.2.7)
|
railties (4.2.6)
|
||||||
actionpack (= 4.2.7)
|
actionpack (= 4.2.6)
|
||||||
activesupport (= 4.2.7)
|
activesupport (= 4.2.6)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
raindrops (0.16.0)
|
raindrops (0.16.0)
|
||||||
rake (11.2.2)
|
rake (11.1.2)
|
||||||
rake-compiler (0.9.9)
|
rake-compiler (0.9.9)
|
||||||
rake
|
rake
|
||||||
rb-fsevent (0.9.7)
|
rb-fsevent (0.9.7)
|
||||||
|
@ -369,10 +369,10 @@ GEM
|
||||||
spork-rails (4.0.0)
|
spork-rails (4.0.0)
|
||||||
rails (>= 3.0.0, < 5)
|
rails (>= 3.0.0, < 5)
|
||||||
spork (>= 1.0rc0)
|
spork (>= 1.0rc0)
|
||||||
sprockets (3.6.3)
|
sprockets (3.6.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.1.1)
|
sprockets-rails (3.0.4)
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
|
|
|
@ -82,7 +82,7 @@ describe PostAlerter do
|
||||||
post.revise(admin, {raw: 'I made another revision'})
|
post.revise(admin, {raw: 'I made another revision'})
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(3)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ describe PostAlerter do
|
||||||
PostAction.remove_act(evil_trout, post, PostActionType.types[:like])
|
PostAction.remove_act(evil_trout, post, PostActionType.types[:like])
|
||||||
PostAction.act(evil_trout, post, PostActionType.types[:like])
|
PostAction.act(evil_trout, post, PostActionType.types[:like])
|
||||||
|
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'notifies on does not notify when never is selected' do
|
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])
|
PostAction.act(evil_trout, post, PostActionType.types[:like])
|
||||||
|
|
||||||
|
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(0)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'notifies on likes correctly' do
|
it 'notifies on likes correctly' do
|
||||||
|
@ -124,7 +124,7 @@ describe PostAlerter do
|
||||||
PostAction.act(admin, post, PostActionType.types[:like])
|
PostAction.act(admin, post, PostActionType.types[:like])
|
||||||
|
|
||||||
# one like
|
# one like
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1)
|
||||||
|
|
||||||
|
|
||||||
post.user.user_option.update_columns(like_notification_frequency:
|
post.user.user_option.update_columns(like_notification_frequency:
|
||||||
|
@ -132,7 +132,7 @@ describe PostAlerter do
|
||||||
|
|
||||||
admin2 = Fabricate(:admin)
|
admin2 = Fabricate(:admin)
|
||||||
PostAction.act(admin2, post, PostActionType.types[:like])
|
PostAction.act(admin2, post, PostActionType.types[:like])
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1)
|
||||||
|
|
||||||
# adds info to the notification
|
# adds info to the notification
|
||||||
notification = Notification.find_by(post_number: 1,
|
notification = Notification.find_by(post_number: 1,
|
||||||
|
@ -146,7 +146,7 @@ describe PostAlerter do
|
||||||
PostAction.remove_act(evil_trout, post, PostActionType.types[:like])
|
PostAction.remove_act(evil_trout, post, PostActionType.types[:like])
|
||||||
|
|
||||||
# rebuilds the missing notification
|
# rebuilds the missing notification
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(1)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(1)
|
||||||
notification = Notification.find_by(post_number: 1,
|
notification = Notification.find_by(post_number: 1,
|
||||||
topic_id: post.topic_id)
|
topic_id: post.topic_id)
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ describe PostAlerter do
|
||||||
end
|
end
|
||||||
|
|
||||||
# first happend within the same day, no need to notify
|
# first happend within the same day, no need to notify
|
||||||
expect(Notification.where(post_number: 1, topic_id: post.topic_id).count).to eq(2)
|
expect(Notification.count(post_number: 1, topic_id: post.topic_id)).to eq(2)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue