Commit 4e5ee366 authored by Benjamin Neff's avatar Benjamin Neff Committed by Dennis Schubert

Keep order of profile tags

closes #7724
parent 4cd8de53
......@@ -11,7 +11,7 @@ class Profile < ApplicationRecord
include Diaspora::Taggable
attr_accessor :tag_string
acts_as_taggable_on :tags
extract_tags_from :tag_string
validates :tag_list, :length => { :maximum => 5 }
......@@ -269,6 +269,17 @@ describe Profile, :type => :model do
expect(object).not_to be_valid
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
expect(Profile.find( eq(string)
it_should_behave_like "it is taggable"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment