removed do bad things
This commit is contained in:
parent
b8bbc58d30
commit
ee89bfaf8f
5 changed files with 6 additions and 6 deletions
|
|
@ -39,7 +39,6 @@ class User
|
||||||
after_create :set_diaspora_handle
|
after_create :set_diaspora_handle
|
||||||
after_create :seed_aspects
|
after_create :seed_aspects
|
||||||
|
|
||||||
before_validation :do_bad_things
|
|
||||||
before_save :downcase_username
|
before_save :downcase_username
|
||||||
|
|
||||||
def self.find_for_authentication(conditions={})
|
def self.find_for_authentication(conditions={})
|
||||||
|
|
@ -314,10 +313,6 @@ class User
|
||||||
"#{self.username}@#{self.terse_url}"
|
"#{self.username}@#{self.terse_url}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def do_bad_things
|
|
||||||
self.password_confirmation = self.password
|
|
||||||
end
|
|
||||||
|
|
||||||
def setup_person
|
def setup_person
|
||||||
self.person.serialized_key ||= User.generate_key.export
|
self.person.serialized_key ||= User.generate_key.export
|
||||||
self.person.save!
|
self.person.save!
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ def create
|
||||||
user = User.create(:email => "#{username}@#{username}.joindiaspora.com",
|
user = User.create(:email => "#{username}@#{username}.joindiaspora.com",
|
||||||
:username => username,
|
:username => username,
|
||||||
:password => "#{username+backer_info[backer_number]['pin'].to_s}",
|
:password => "#{username+backer_info[backer_number]['pin'].to_s}",
|
||||||
|
:password_confirmation => "#{username+backer_info[backer_number]['pin'].to_s}",
|
||||||
:url=> "http://#{username}.joindiaspora.com/",
|
:url=> "http://#{username}.joindiaspora.com/",
|
||||||
:person => Person.new(
|
:person => Person.new(
|
||||||
:diaspora_handle => "#{username}@#{username}.joindiaspora.com",
|
:diaspora_handle => "#{username}@#{username}.joindiaspora.com",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ url = "http://#{host}/"
|
||||||
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
|
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
|
||||||
:username => "tom",
|
:username => "tom",
|
||||||
:password => "evankorth",
|
:password => "evankorth",
|
||||||
|
:password_confirmation => "evankorth",
|
||||||
:url=> "http://#{username}.joindiaspora.com/"
|
:url=> "http://#{username}.joindiaspora.com/"
|
||||||
:person => Person.new(
|
:person => Person.new(
|
||||||
:diaspora_handle => "tom@tom.joindiaspora.com",
|
:diaspora_handle => "tom@tom.joindiaspora.com",
|
||||||
|
|
@ -24,6 +25,7 @@ user2 = User.instantiate!( :email => "korth@tom.joindiaspora.com",
|
||||||
:username => "korth",
|
:username => "korth",
|
||||||
:url=> "http://#{username}.joindiaspora.com/"
|
:url=> "http://#{username}.joindiaspora.com/"
|
||||||
:password => "evankorth",
|
:password => "evankorth",
|
||||||
|
:password_confirmation => "evankorth",
|
||||||
:person => Person.new( :diaspora_handle => "korth@tom.joindiaspora.com",
|
:person => Person.new( :diaspora_handle => "korth@tom.joindiaspora.com",
|
||||||
:url => url,
|
:url => url,
|
||||||
:profile => Profile.new( :first_name => "Evan",
|
:profile => Profile.new( :first_name => "Evan",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ remote_url = "http://tom.joindiaspora.com/"
|
||||||
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
|
user = User.instantiate!( :email => "tom@tom.joindiaspora.com",
|
||||||
:username => "tom",
|
:username => "tom",
|
||||||
:password => "evankorth",
|
:password => "evankorth",
|
||||||
|
:password_confirmation => "evankorth",
|
||||||
:url => remote_url,
|
:url => remote_url,
|
||||||
:person => {
|
:person => {
|
||||||
:diaspora_handle => "tom@tom.joindiaspora.com",
|
:diaspora_handle => "tom@tom.joindiaspora.com",
|
||||||
|
|
@ -22,6 +23,7 @@ user.person.save!
|
||||||
|
|
||||||
user2 = User.instantiate!( :email => "korth@tom.joindiaspora.com",
|
user2 = User.instantiate!( :email => "korth@tom.joindiaspora.com",
|
||||||
:password => "evankorth",
|
:password => "evankorth",
|
||||||
|
:password_confirmation => "evankorth",
|
||||||
:username => "korth",
|
:username => "korth",
|
||||||
:url => remote_url,
|
:url => remote_url,
|
||||||
:person => { :diaspora_handle => "korth@tom.joindiaspora.com",
|
:person => { :diaspora_handle => "korth@tom.joindiaspora.com",
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ describe Aspect do
|
||||||
|
|
||||||
it 'belong to a user' do
|
it 'belong to a user' do
|
||||||
@aspect.user.id.should == @user.id
|
@aspect.user.id.should == @user.id
|
||||||
@user.aspects.size.should == 1
|
@user.aspects.size.should == 3
|
||||||
@user.aspects.first.id.should == @aspect.id
|
@user.aspects.first.id.should == @aspect.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue