diff --git a/app/views/contacts/featured.haml b/app/views/contacts/featured.haml index b3e9b4f0c..6f0b48514 100644 --- a/app/views/contacts/featured.haml +++ b/app/views/contacts/featured.haml @@ -20,18 +20,19 @@ %br #featured_users - - @people.each do |person| - .user_card - = person_image_link(person, :size => :thumb_large) - %h4 - = person.name + - unless @people.blank? + - @people.each do |person| + .user_card + = person_image_link(person, :size => :thumb_large) + %h4 + = person.name - .tags - - 5.times do |n| - - person.profile.tags.each do |tg| - = "##{tg}" + .tags + - 5.times do |n| + - person.profile.tags.each do |tg| + = "##{tg}" - .add_user_to_aspect - = render :partial => 'people/relationship_action', - :locals => { :person => person, :contact => current_user.contact_for(person), - :current_user => current_user } + .add_user_to_aspect + = render :partial => 'people/relationship_action', + :locals => { :person => person, :contact => current_user.contact_for(person), + :current_user => current_user } diff --git a/config/application.yml.example b/config/application.yml.example index 9ab506ff5..8ce020ec1 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -136,6 +136,7 @@ defaults: &defaults # Featured users # (expressed as an array of Diaspora IDs) featured_users: + - 'diasporahq@joindiaspora.com' # Use this section to override default settings in specific environments development: diff --git a/spec/controllers/contacts_controller_spec.rb b/spec/controllers/contacts_controller_spec.rb index 929aefd1f..81a15923b 100644 --- a/spec/controllers/contacts_controller_spec.rb +++ b/spec/controllers/contacts_controller_spec.rb @@ -68,4 +68,28 @@ describe ContactsController do save_fixture(html_for("body"), "aspects_manage") end end + + describe '#featued' do + it 'succeeds' do + get :featured + response.should be_success + end + + it 'gets queries for users in the app config' do + AppConfig[:featured_users] = [alice.diaspora_handle] + + get :featured + assigns[:people].should == [alice.person] + end + + it 'fetches the webfinger profiles' do + AppConfig[:featured_users] = [alice.diaspora_handle] + + wf = mock + wf.should_receive(:fetch) + Webfinger.should_receive(:new).with(alice.diaspora_handle).and_return(wf) + + get :featured + end + end end diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index 3a0ec81fa..6b7e73735 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -325,28 +325,4 @@ describe PeopleController do get :retrieve_remote, :diaspora_handle => @user.diaspora_handle end end - - describe '#featued' do - it 'succeeds' do - get :featured - response.should be_success - end - - it 'gets queries for users in the app config' do - AppConfig[:featured_users] = [alice.diaspora_handle] - - get :featured - assigns[:people].should == [alice.person] - end - - it 'fetches the webfinger profiles' do - AppConfig[:featured_users] = [alice.diaspora_handle] - - wf = mock - wf.should_receive(:fetch) - Webfinger.should_receive(:new).with(alice.diaspora_handle).and_return(wf) - - get :featured - end - end end