Sha256: bc98ad9267e98b9abab1c4672a81237973149f85b9df914742fe3af5e26a66f7

Contents?: true

Size: 1.97 KB

Versions: 8

Compression:

Stored size: 1.97 KB

Contents

require 'test_helper'
#require RAILS_ROOT + '/lib/asf/activerecord-activesalesforce-adapter'

class Salesforce::ChatterFeedTest < ActiveSupport::TestCase
  def notest_get_chatter_feed_without_content_file
    user = Salesforce::User.first
    chatter_feed_finder = Salesforce::ChatterFeed.new
    account_feed = Salesforce::AccountFeed.first

    object_id = account_feed.id
    feed_no_attachment = chatter_feed_finder.get_all_chatter_feeds_without_attachments(object_id, 'Account', user.connection.binding, 'test-session-id')
    assert feed_no_attachment
  end

  def notest_get_chatter_feed_with_content_file
    user = Salesforce::User.first
    chatter_feed_finder = Salesforce::ChatterFeed.new
    #account_feed = Salesforce::AccountFeed.first
    dir_name = 'test-session-id'

    #object_id = account_feed.id
    #chatter_feed_with_attachment = chatter_feed_finder.get_all_chatter_feeds_with_attachments('001A0000009ZtSkIAK', 'Account', user.connection.binding, dir_name)
    query_conditions = ["type = :type", {:type => "ContentPost"}]
    sfutility = Salesforce::SfUtility.new
    results = Salesforce::SfUtility.salesforce_object_find_by_type_and_conditions("AccountFeed", query_conditions)
    results.each do |res|
      chatter_feed_with_attachment = chatter_feed_finder.get_all_chatter_feeds_with_attachments(res.parent_id, 'Account', user.connection.binding, dir_name)
    #  assert !chatter_feed_with_attachment.empty?
    end

    assert !results.empty?
  end

  # testing against search feature of the ChatterFeed class.
  def test_search_chatter_feed
    user = Salesforce::User.first

    message = Time.now.to_s + ': a new message'
    user.current_status = message
    user.save

    chatter_feed_finder = Salesforce::ChatterFeed.new

    query_string = message
    search_results = chatter_feed_finder.search_chatter_feeds('User', query_string, user.connection.binding)
    assert search_results
    # Cleaning up.
    result = Salesforce::SfBase.delete(search_results.last.Id)
  end



end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
asf-soap-adapter-1.3.1 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
asf-soap-adapter-1.3.0 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
asf-soap-adapter-1.1.0 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
asf-soap-adapter-1.0.4 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
ryandotsmith-asf-soap-adapter-1.0.3 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
asf-soap-adapter-1.0.2 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
asf-soap-adapter-1.0.1 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb
asf-soap-adapter-1.0.0 test/asf-soap-adapter-rails-app/test/unit/salesforce/chatter_feed_test.rb