Commit e186811a authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff
Browse files

Remove unused contacts link methods

closes #7221
parent 610700ff
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -33,14 +33,6 @@ module ApplicationHelper
      "bookmarklet('#{bookmarklet_url}', #{width}, #{height});"
  end

  def contacts_link
    if current_user.contacts.size > 0
      contacts_path
    else
      community_spotlight_path
    end
  end

  def all_services_connected?
    current_user.services.size == AppConfig.configured_services.size
  end
+0 −12
Original line number Diff line number Diff line
@@ -85,18 +85,6 @@ class Stream::Aspect < Stream::Base
    @all_aspects ||= aspect_ids.length == user.aspects.size
  end

  # Provides a link to the user to the contacts page that corresponds with
  # the stream's active aspects.
  #
  # @return [String] Link to contacts
  def contacts_link
    if for_all_aspects? || aspect_ids.size > 1
      Rails.application.routes.url_helpers.contacts_path
    else
      Rails.application.routes.url_helpers.contacts_path(:a_id => aspect.id)
    end
  end

  # This is perfomance optimization, as everyone in your aspect stream you have
  # a contact.
  #
+0 −5
Original line number Diff line number Diff line
@@ -49,11 +49,6 @@ class Stream::Base
      includes(:profile)
  end

  # @return [String]
  def contacts_link
    Rails.application.routes.url_helpers.contacts_path
  end

  # @return [Boolean]
  def for_all_aspects?
    true
+0 −18
Original line number Diff line number Diff line
@@ -10,24 +10,6 @@ describe ApplicationHelper, :type => :helper do
    @person = FactoryGirl.create(:person)
  end

  describe "#contacts_link" do
    before do
      def current_user
        @current_user
      end
    end

    it 'links to community spotlight' do
      @current_user = FactoryGirl.create(:user)
      expect(contacts_link).to eq(community_spotlight_path)
    end

    it 'links to contacts#index' do
      @current_user = alice
      expect(contacts_link).to eq(contacts_path)
    end
  end

  describe "#all_services_connected?" do
    before do
      AppConfig.configured_services = [1, 2, 3]
+0 −6
Original line number Diff line number Diff line
@@ -6,12 +6,6 @@ describe Stream::Base do
    @stream = Stream::Base.new(alice)
  end

  describe '#contacts_link' do
    it 'should default to your contacts page' do
      expect(@stream.contacts_link).to match(/contacts/)
    end
  end

  describe '#stream_posts' do
    it "should returns the posts.for_a_stream" do
      posts = double
Loading