Skip to content
Extraits de code Groupes Projets
Valider cc6f82fb rédigé par John Drummond's avatar John Drummond
Parcourir les fichiers

Added test for new plantext tag without a # symbol and fixed broken code.

parent f7abaab2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -25,7 +25,7 @@ class ProfilesController < ApplicationController ...@@ -25,7 +25,7 @@ class ProfilesController < ApplicationController
extra_tag.strip! extra_tag.strip!
unless extra_tag == "" unless extra_tag == ""
extra_tag = "##{extra_tag}" unless extra_tag.start_with?( "#" ) extra_tag = "##{extra_tag}" unless extra_tag.start_with?( "#" )
params[:tags] += ",##{extra_tag}" params[:tags] += " #{extra_tag}"
end end
end end
end end
......
...@@ -59,6 +59,15 @@ describe ProfilesController do ...@@ -59,6 +59,15 @@ describe ProfilesController do
@user.person(true).profile.tag_list.to_set.should == ['apples', 'oranges', 'pears'].to_set @user.person(true).profile.tag_list.to_set.should == ['apples', 'oranges', 'pears'].to_set
end 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 context 'with a profile photo set' do
before do before do
@params = { :id => @user.person.id, @params = { :id => @user.person.id,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter