diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index f2b97ac6b5d03995fd00216d699e693ec6b882d5..a7b10d7c671f7459808701bd0e49808befe6b394 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -25,7 +25,7 @@ class ProfilesController < ApplicationController extra_tag.strip! unless extra_tag == "" extra_tag = "##{extra_tag}" unless extra_tag.start_with?( "#" ) - params[:tags] += ",##{extra_tag}" + params[:tags] += " #{extra_tag}" end end end diff --git a/spec/controllers/profiles_controller_spec.rb b/spec/controllers/profiles_controller_spec.rb index 4d760e3f8ea78ce5df609e02d3ddc8f83b972ccf..4f40af60c03261cbc9f748c1ad2b81a81a22c21f 100644 --- a/spec/controllers/profiles_controller_spec.rb +++ b/spec/controllers/profiles_controller_spec.rb @@ -59,6 +59,15 @@ describe ProfilesController do @user.person(true).profile.tag_list.to_set.should == ['apples', 'oranges', 'pears'].to_set end + it 'sets plaintext tags without #' do + params = { :id => @user.person.id, + :tags => ',#apples,#oranges,', + :profile => {:tag_string => 'bananas'} } + + put :update, params + @user.person(true).profile.tag_list.to_set.should == ['apples', 'oranges', 'bananas'].to_set + end + context 'with a profile photo set' do before do @params = { :id => @user.person.id,