Drop contacts.json

This commit is contained in:
Steffen van Bergerem 2016-08-09 16:37:36 +02:00
parent f1e9c99866
commit 9f28b935b9
No known key found for this signature in database
GPG key ID: 2F08F75F9525C7E0
2 changed files with 0 additions and 29 deletions

View file

@ -13,13 +13,6 @@ class ContactsController < ApplicationController
# Used by the mobile site
format.mobile { set_up_contacts_mobile }
# Used to populate mentions in the publisher
format.json {
aspect_ids = params[:aspect_ids] || current_user.aspects.map(&:id)
@people = Person.all_from_aspects(aspect_ids, current_user).for_json
render :json => @people.to_json
}
end
end

View file

@ -48,28 +48,6 @@ describe ContactsController, :type => :controller do
expect(contacts.to_set).to eq(bob.contacts.to_set)
end
end
context 'format json' do
it 'assumes all aspects if none are specified' do
get :index, :format => 'json'
expect(assigns[:people].map(&:id)).to match_array(bob.contacts.map { |c| c.person.id })
expect(response).to be_success
end
it 'returns the contacts for multiple aspects' do
get :index, :aspect_ids => bob.aspect_ids, :format => 'json'
expect(assigns[:people].map(&:id)).to match_array(bob.contacts.map { |c| c.person.id })
expect(response).to be_success
end
it 'does not return duplicate contacts' do
aspect = bob.aspects.create(:name => 'hilarious people')
aspect.contacts << bob.contact_for(eve.person)
get :index, :format => 'json', :aspect_ids => bob.aspect_ids
expect(assigns[:people].map { |p| p.id }.uniq).to eq(assigns[:people].map { |p| p.id })
expect(assigns[:people].map(&:id)).to match_array(bob.contacts.map { |c| c.person.id })
end
end
end
describe "#search" do