Sha256: f6ac3b4f86a4aeb07ea785e00568113280b00f1fa7affd6118516448cbf5472c
Contents?: true
Size: 1.57 KB
Versions: 2
Compression:
Stored size: 1.57 KB
Contents
require 'test_helper' class WsSearchTest < Test::Unit::TestCase def setup $sid2 ||= Landslider.login('LOGINTOKEN=' + LS_INSTANCE_NAME)[:session_id] end def test_ws_search_object search = Landslider::WsSearch.new('AccountName', 'Equals', 'Boston') assert_equal 'AccountName', search.field_id assert_equal 'Equals', search.operator assert_equal 'Boston', search.query_value end def test_get_accounts_without_search_criteria result = Landslider.get_accounts($sid2, 1, 25) assert_equal false, result[:error] assert_equal 6, result[:results_returned] end def test_get_accounts_with_search_criteria search = Landslider::WsSearch.new('AccountName', 'Equals', 'Boston') result = Landslider.get_accounts($sid2, 1, 25, search) assert_equal false, result[:error] assert_equal 1, result[:results_returned] end def test_get_opportunities_without_search_criteria result = Landslider.get_opportunities($sid2, 1, 25) assert_equal false, result[:error] assert_equal 4, result[:results_returned] end def test_get_opportunities_with_search_criteria target_phase_name = 'Prospect' search = Landslider::WsSearch.new('CurrentPhaseName', 'Contains', target_phase_name) result = Landslider.get_opportunities($sid2, 1, 25, search) assert_equal false, result[:error] assert_equal 3, result[:results_returned] assert_equal target_phase_name, result[:opportunities][0][:current_phase_name] assert_equal target_phase_name, result[:opportunities][1][:current_phase_name] assert_equal target_phase_name, result[:opportunities][2][:current_phase_name] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
landslider-0.5.5 | test/ws_search_test.rb |
landslider-0.5.4 | test/ws_search_test.rb |