Commit 38d3cffe7a0b557e3637b0e07851ade704a8532c

Authored by Victor Costa
1 parent 308261af
Exists in master

Fix tests

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
1 1 require_relative '../test_helper'
2   -require_relative '../../../../test/unit/api/test_helper'
  2 +require_relative '../../../../test/api/test_helper'
3 3  
4 4 class APITest < ActiveSupport::TestCase
5 5  
... ...
test/unit/comment_test.rb
... ... @@ -298,7 +298,7 @@ class CommentTest &lt; 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
... ...