Skip to content
Extraits de code Groupes Projets
Valider 03a55144 rédigé par maxwell's avatar maxwell
Parcourir les fichiers

Merge branch 'master' of github.com:diaspora/diaspora

parents 0a8af9e7 4bbbbf6b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -76,6 +76,7 @@ class User
end
def self.find_for_authentication(conditions={})
conditions[:username] = conditions[:username].downcase
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
conditions[:email] = conditions.delete(:username)
end
......
......@@ -147,7 +147,7 @@ var View = {
avatars: {
bind: function() {
$(".left_pane img.avatar, #manage_aspect_zones img.avatar").tipsy({
$("#left_pane img.avatar, #manage_aspect_zones img.avatar").tipsy({
live: true
});
}
......
......@@ -245,9 +245,15 @@ describe User do
end
describe ".find_for_authentication" do
it "preserves case" do
before do
user
user2
end
it 'finds a user' do
User.find_for_authentication(:username => user.username).should == user
User.find_for_authentication(:username => user.username.upcase).should be_nil
end
it "does not preserve case" do
User.find_for_authentication(:username => user.username.upcase).should == user
end
end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter