Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
03a5514400
3 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue