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
|
end
|
||||||
|
|
||||||
def self.find_for_authentication(conditions={})
|
def self.find_for_authentication(conditions={})
|
||||||
|
conditions[:username] = conditions[:username].downcase
|
||||||
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
|
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
|
||||||
conditions[:email] = conditions.delete(:username)
|
conditions[:email] = conditions.delete(:username)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ var View = {
|
||||||
|
|
||||||
avatars: {
|
avatars: {
|
||||||
bind: function() {
|
bind: function() {
|
||||||
$(".left_pane img.avatar, #manage_aspect_zones img.avatar").tipsy({
|
$("#left_pane img.avatar, #manage_aspect_zones img.avatar").tipsy({
|
||||||
live: true
|
live: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -245,9 +245,15 @@ describe User do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".find_for_authentication" do
|
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).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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue