Skip to content
Extraits de code Groupes Projets
Valider 7d3a6a06 rédigé par Steven Fuchs's avatar Steven Fuchs
Parcourir les fichiers

add spec to ake sure background query is only set when a full diaspora id is given.

parent ac8cd836
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -35,7 +35,7 @@ class PeopleController < ApplicationController
if diaspora_id?(search_query)
@people = Person.where(:diaspora_handle => search_query.downcase)
Webfinger.in_background(search_query) if @people.empty?
@background_query = search_query
@background_query = search_query.downcase
end
@people = @people.paginate(:page => params[:page], :per_page => 15)
@hashes = hashes_for_people(@people, @aspects)
......
......@@ -52,6 +52,11 @@ describe PeopleController do
get :index, :q => "Eugene@Example.ORG"
assigns[:people][0].id.should == @unsearchable_eugene.id
end
it 'sets the background query task' do
get :index, :q => "Eugene@Example.ORG"
assigns[:background_query].should == "eugene@example.org"
end
end
context 'query is a tag' do
......@@ -77,6 +82,11 @@ describe PeopleController do
assigns[:hashes].should_not be_nil
end
it 'does not set the background query task' do
get :index, :q => "Korth"
assigns[:background_query].should_not be_present
end
it "assigns people" do
eugene2 = Factory(:person,
:profile => Factory.build(:profile, :first_name => "Eugene",
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter