Remove special-case for diaspora-handle lookups in people controller.
Thss partly reverts a475d5fb62. The special case here was only ever used for the chat, which no longer exists.
This commit is contained in:
parent
4c46ca1a94
commit
0810fa77e9
2 changed files with 4 additions and 20 deletions
|
|
@ -126,16 +126,10 @@ class PeopleController < ApplicationController
|
|||
|
||||
def find_person
|
||||
username = params[:username]
|
||||
@person = if diaspora_id?(username)
|
||||
Person.where({
|
||||
diaspora_handle: username.downcase
|
||||
}).first
|
||||
else
|
||||
Person.find_from_guid_or_username({
|
||||
id: params[:id] || params[:person_id],
|
||||
username: username
|
||||
})
|
||||
end
|
||||
@person = Person.find_from_guid_or_username(
|
||||
id: params[:id] || params[:person_id],
|
||||
username: username
|
||||
)
|
||||
|
||||
raise ActiveRecord::RecordNotFound if @person.nil?
|
||||
raise Diaspora::AccountClosed if @person.closed_account?
|
||||
|
|
|
|||
|
|
@ -206,16 +206,6 @@ describe PeopleController, type: :controller do
|
|||
expect(assigns(:presenter).to_json).to eq(@presenter.to_json)
|
||||
end
|
||||
|
||||
it "404s if no person is found via diaspora handle" do
|
||||
get :show, params: {username: "delicious@pod.net"}
|
||||
expect(response.code).to eq("404")
|
||||
end
|
||||
|
||||
it "finds a person via diaspora handle" do
|
||||
get :show, params: {username: @person.diaspora_handle}
|
||||
expect(assigns(:presenter).to_json).to eq(@presenter.to_json)
|
||||
end
|
||||
|
||||
it "redirects home for closed account" do
|
||||
@person = FactoryBot.create(:person, closed_account: true)
|
||||
get :show, params: {id: @person.to_param}
|
||||
|
|
|
|||
Loading…
Reference in a new issue