Commit 38d3cffe7a0b557e3637b0e07851ade704a8532c
1 parent
308261af
Exists in
master
Fix tests
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
lib/gamification_plugin/badge.rb
... | ... | @@ -18,6 +18,6 @@ class GamificationPlugin::Badge < ActiveRecord::Base |
18 | 18 | Merit::BadgesSash.where(:badge_id => self.id).destroy_all |
19 | 19 | end |
20 | 20 | |
21 | - scope :notification_pending, :include => :badges_sash, :conditions => {:badges_sashes => {:notified_user => false}} | |
21 | + scope :notification_pending, -> { includes(:badges_sash).where(:badges_sashes => {:notified_user => false}) } | |
22 | 22 | |
23 | 23 | end | ... | ... |
test/unit/api_test.rb
test/unit/comment_test.rb
... | ... | @@ -298,7 +298,7 @@ class CommentTest < ActiveSupport::TestCase |
298 | 298 | GamificationPlugin::Badge.create!(:owner => organization, :name => 'comment_author') |
299 | 299 | GamificationPlugin.gamification_set_rules(environment) |
300 | 300 | article.profile = organization |
301 | - | |
301 | + article.save! | |
302 | 302 | 5.times { create(Comment, :source => article, :author_id => person.id) } |
303 | 303 | assert_equal 'comment_author', person.badges.first.name |
304 | 304 | end | ... | ... |