Loading app/models/profile.rb +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ class Profile < ApplicationRecord include Diaspora::Taggable attr_accessor :tag_string acts_as_taggable_on :tags acts_as_ordered_taggable extract_tags_from :tag_string validates :tag_list, :length => { :maximum => 5 } Loading spec/models/profile_spec.rb +11 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,17 @@ describe Profile, :type => :model do expect(object).not_to be_valid end it "keeps the order of the tag_string" do ActsAsTaggableOn::Tag.create(name: "test2") ActsAsTaggableOn::Tag.create(name: "test1") string = "#test1 #test2" object.tag_string = string object.save expect(Profile.find(object.id).tag_string).to eq(string) end it_should_behave_like "it is taggable" end Loading Loading
app/models/profile.rb +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ class Profile < ApplicationRecord include Diaspora::Taggable attr_accessor :tag_string acts_as_taggable_on :tags acts_as_ordered_taggable extract_tags_from :tag_string validates :tag_list, :length => { :maximum => 5 } Loading
spec/models/profile_spec.rb +11 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,17 @@ describe Profile, :type => :model do expect(object).not_to be_valid end it "keeps the order of the tag_string" do ActsAsTaggableOn::Tag.create(name: "test2") ActsAsTaggableOn::Tag.create(name: "test1") string = "#test1 #test2" object.tag_string = string object.save expect(Profile.find(object.id).tag_string).to eq(string) end it_should_behave_like "it is taggable" end Loading