diff --git a/lib/merit/point_rules.rb b/lib/merit/point_rules.rb index 1b9e773..ecf0d7b 100644 --- a/lib/merit/point_rules.rb +++ b/lib/merit/point_rules.rb @@ -9,7 +9,7 @@ module Merit :to => :author, :value => 1, :description => _('Point weight for comment author'), - :default_weight => 10 + :default_weight => 150 }, :comment_article_author => { :action => 'comment#create', @@ -17,7 +17,7 @@ module Merit :to => lambda {|comment| comment.source.author}, :value => 1, :description => _('Point weight for article author of a comment'), - :default_weight => 10 + :default_weight => 50 }, :article_author => { :action => 'article#create', @@ -33,7 +33,7 @@ module Merit :to => :profile, :value => 1, :description => _('Point weight for article community'), - :default_weight => 500, + :default_weight => 600, :condition => lambda {|target| target.profile.community? } }, :vote_voteable_author => { @@ -43,7 +43,7 @@ module Merit :profile => lambda {|vote| vote.voteable.profile}, :value => lambda {|vote| vote.vote}, :description => _('Point weight for the author of a voted content'), - :default_weight => 5 + :default_weight => 50 }, :vote_voteable => { :action => 'vote#create', @@ -52,7 +52,7 @@ module Merit :profile => lambda {|vote| vote.voteable.profile}, :value => lambda {|vote| vote.vote}, :description => _('Point weight for a voted content'), - :default_weight => 5 + :default_weight => 50 }, # TODO comment_voter and article_voter } diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index 4fc71c1..38ee176 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -45,7 +45,7 @@ class ArticleTest < ActiveSupport::TestCase should 'add merit points to article owner when an user like it' do article = create(Article, :name => 'Test', :profile => person, :author => person) - assert_difference 'article.author.points(:category => :vote_voteable_author)', 5 do + assert_difference 'article.author.points(:category => :vote_voteable_author)', 50 do Vote.create!(:voter => person, :voteable => article, :vote => 1) end end @@ -54,7 +54,7 @@ class ArticleTest < ActiveSupport::TestCase article = create(Article, :name => 'Test', :profile => person, :author => person) article = article.reload - assert_difference 'article.points(:category => :vote_voteable)', 5 do + assert_difference 'article.points(:category => :vote_voteable)', 50 do Vote.create!(:voter => person, :voteable => article, :vote => 1) end end diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index d1d8011..474b040 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -46,7 +46,7 @@ class CommentTest < ActiveSupport::TestCase should 'add merit points to comment owner when an user like his comment' do comment = create(Comment, :source => article, :author_id => person.id) - assert_difference 'comment.author.points(:category => :vote_voteable_author)', 5 do + assert_difference 'comment.author.points(:category => :vote_voteable_author)', 50 do Vote.create!(:voter => person, :voteable => comment, :vote => 1) end end @@ -55,7 +55,7 @@ class CommentTest < ActiveSupport::TestCase comment = create(Comment, :source => article, :author_id => person.id) Vote.create!(:voter => person, :voteable => comment, :vote => 1) - assert_difference 'comment.author.points', -5 do + assert_difference 'comment.author.points', -50 do Vote.where(:voteable_id => comment.id).destroy_all end end @@ -63,7 +63,7 @@ class CommentTest < ActiveSupport::TestCase should 'subtract merit points from comment owner when an user dislike his comment' do comment = create(Comment, :source => article, :author_id => person.id) - assert_difference 'comment.author.points(:category => :vote_voteable_author)', -5 do + assert_difference 'comment.author.points(:category => :vote_voteable_author)', -50 do Vote.create!(:voter => person, :voteable => comment, :vote => -1) end end @@ -72,7 +72,7 @@ class CommentTest < ActiveSupport::TestCase comment = create(Comment, :source => article, :author_id => person.id) Vote.create!(:voter => person, :voteable => comment, :vote => -1) - assert_difference 'comment.author.points', 5 do + assert_difference 'comment.author.points', 50 do Vote.where(:voteable_id => comment.id).destroy_all end end -- libgit2 0.21.2