diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index c23380341..8e9b670f6 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -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 diff --git a/spec/controllers/contacts_controller_spec.rb b/spec/controllers/contacts_controller_spec.rb index c96131fba..d2af43e8d 100644 --- a/spec/controllers/contacts_controller_spec.rb +++ b/spec/controllers/contacts_controller_spec.rb @@ -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