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,6 +20,7 @@
%br
#featured_users
- unless @people.blank?
- @people.each do |person|
.user_card
= person_image_link(person, :size => :thumb_large)

View file

@ -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:

View file

@ -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

View file

@ -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