the profile cannot massassign diaspora handle
This commit is contained in:
parent
38a1b948ed
commit
e50f29b032
2 changed files with 9 additions and 0 deletions
|
|
@ -32,6 +32,9 @@ class Profile
|
||||||
|
|
||||||
before_save :strip_names
|
before_save :strip_names
|
||||||
|
|
||||||
|
attr_accessible :first_name, :last_name, :image_url, :birthday, :gender, :bio, :searchable
|
||||||
|
|
||||||
|
|
||||||
def person
|
def person
|
||||||
self._parent_document
|
self._parent_document
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -69,5 +69,11 @@ describe PeopleController do
|
||||||
:owner_id => new_user.id}
|
:owner_id => new_user.id}
|
||||||
user.person.reload.owner_id.should_not == new_user.id
|
user.person.reload.owner_id.should_not == new_user.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not overwrite the profile diaspora handle' do
|
||||||
|
handle_params = {'profile' => {'diaspora_handle' => 'abc@a.com'}}
|
||||||
|
put :update, :id => user.person.id, :person => handle_params
|
||||||
|
user.person.reload.profile[:diaspora_handle].should_not == 'abc@a.com'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue