diff --git a/app/models/concerns/taggable.rb b/app/models/concerns/taggable.rb index 52efc04a7..9126e271a 100644 --- a/app/models/concerns/taggable.rb +++ b/app/models/concerns/taggable.rb @@ -3,7 +3,7 @@ module Taggable included do acts_as_taggable - validate :max_number_of_tags + validate :max_number_of_tags, on: :create end def tag_list_with_limit(limit = nil) diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 6e5acb379..964f8f057 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -194,6 +194,22 @@ describe Proposal do end end + describe '#cached_votes_up' do + + describe "with deprecated long tag list" do + + it "should increase number of cached_total_votes" do + proposal = create(:proposal) + + tag_list = ["tag1", "tag2", "tag3", "tag4", "tag5", "tag6", "tag7"] + proposal.update_attribute(:tag_list, tag_list) + + expect(proposal.update_cached_votes).to eq(true) + end + + end + end + describe '#hot_score' do let(:now) { Time.now }