added featured users dg iz

This commit is contained in:
Ilyaaaaaaaaaaaaa Zhitomirskiy 2011-07-29 18:58:40 -07:00
parent e42d7273a8
commit 3a6f0583c7
4 changed files with 39 additions and 37 deletions

View file

@ -20,18 +20,19 @@
%br %br
#featured_users #featured_users
- @people.each do |person| - unless @people.blank?
.user_card - @people.each do |person|
= person_image_link(person, :size => :thumb_large) .user_card
%h4 = person_image_link(person, :size => :thumb_large)
= person.name %h4
= person.name
.tags .tags
- 5.times do |n| - 5.times do |n|
- person.profile.tags.each do |tg| - person.profile.tags.each do |tg|
= "##{tg}" = "##{tg}"
.add_user_to_aspect .add_user_to_aspect
= render :partial => 'people/relationship_action', = render :partial => 'people/relationship_action',
:locals => { :person => person, :contact => current_user.contact_for(person), :locals => { :person => person, :contact => current_user.contact_for(person),
:current_user => current_user } :current_user => current_user }

View file

@ -136,6 +136,7 @@ defaults: &defaults
# Featured users # Featured users
# (expressed as an array of Diaspora IDs) # (expressed as an array of Diaspora IDs)
featured_users: featured_users:
- 'diasporahq@joindiaspora.com'
# Use this section to override default settings in specific environments # Use this section to override default settings in specific environments
development: development:

View file

@ -68,4 +68,28 @@ describe ContactsController do
save_fixture(html_for("body"), "aspects_manage") save_fixture(html_for("body"), "aspects_manage")
end end
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 end

View file

@ -325,28 +325,4 @@ describe PeopleController do
get :retrieve_remote, :diaspora_handle => @user.diaspora_handle get :retrieve_remote, :diaspora_handle => @user.diaspora_handle
end end
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 end