landslider 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
data/.yardopts ADDED
@@ -0,0 +1,3 @@
1
+ --title 'Landslider API Documentation'
2
+ --charset utf-8
3
+ --no-cache
data/README.md CHANGED
@@ -26,7 +26,7 @@ Installation
26
26
  Documentation
27
27
  -------------
28
28
 
29
- Read the [ruby doc](http://www.rubydoc.info/github/j4y/landslider/master/frames).
29
+ Read the [ruby doc](http://rdoc.info/github/j4y/landslider).
30
30
 
31
31
  Configuration
32
32
  -------------
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 5
4
- :patch: 11
4
+ :patch: 12
5
5
  :build:
data/landslider.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{landslider}
8
- s.version = "0.5.11"
8
+ s.version = "0.5.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jay Prall"]
12
- s.date = %q{2011-05-13}
12
+ s.date = %q{2011-05-18}
13
13
  s.default_executable = %q{generate_api_key.rb}
14
14
  s.description = %q{Landslider is a ruby interface to the Landslide SOAP-based API}
15
15
  s.email = %q{jay@j4y.net}
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  "README.md"
20
20
  ]
21
21
  s.files = [
22
+ ".yardopts",
22
23
  "Gemfile",
23
24
  "HISTORY.md",
24
25
  "LICENSE",
@@ -66,6 +67,7 @@ Gem::Specification.new do |s|
66
67
  "lib/landslider/entities/ws_user.rb",
67
68
  "lib/landslider/entities/ws_user_search.rb",
68
69
  "test/get_account_types_test.rb",
70
+ "test/get_accounts_test.rb",
69
71
  "test/landslider_test.rb",
70
72
  "test/test_helper.rb",
71
73
  "test/ws_account_note_search_test.rb",
@@ -81,6 +83,7 @@ Gem::Specification.new do |s|
81
83
  s.summary = %q{Landslide Ruby}
82
84
  s.test_files = [
83
85
  "test/get_account_types_test.rb",
86
+ "test/get_accounts_test.rb",
84
87
  "test/landslider_test.rb",
85
88
  "test/test_helper.rb",
86
89
  "test/ws_account_note_search_test.rb",
@@ -2,10 +2,11 @@
2
2
  class Landslider
3
3
 
4
4
  class WsSearch
5
-
6
- # @param [Hash] params
7
- # An optional Hash to specify first_result_position and total_results_requested
8
- def initialize(params={})
5
+
6
+ # @param [Hash] params the params to use for the search
7
+ # @option params [Integer] :first_result_position Sets the starting index of records you want to retrieve. defaults to 1
8
+ # @option params [Integer] :total_results_requested Sets the maximum number of records to retrieve. defaults to 25
9
+ def initialize(params = {})
9
10
  @first_result_position = params.fetch(:first_result_position) if params.key?(:first_result_position)
10
11
  @total_results_requested = params.fetch(:total_results_requested) if params.key?(:total_results_requested)
11
12
  end
@@ -0,0 +1,48 @@
1
+
2
+ require 'test_helper'
3
+
4
+ class GetAccountsTest < Test::Unit::TestCase
5
+
6
+ def setup
7
+ # uncomment this line to debug
8
+ #Landslider.logger = $stdout
9
+ $sesson_id1 ||= Landslider.login('LOGINTOKEN=' + LS_INSTANCE_NAME)[:session_id]
10
+ end
11
+
12
+ def test_get_accounts_without_search
13
+
14
+ result = Landslider.get_accounts($sesson_id1)
15
+
16
+ assert_not_nil result
17
+ assert_equal false, result[:error]
18
+ assert_kind_of Array, result[:accounts]
19
+ assert_equal 6, result[:accounts].size
20
+
21
+ end
22
+
23
+ def test_get_accounts_with_simple_search
24
+
25
+ simple_search = Landslider::WsSearch.new({:first_result_position => 1, :total_results_requested => 1})
26
+ result = Landslider.get_accounts($sesson_id1, simple_search)
27
+
28
+ assert_not_nil result
29
+ assert_equal false, result[:error]
30
+ assert_kind_of Array, result[:accounts]
31
+ assert_equal 1, result[:accounts].size
32
+
33
+ end
34
+
35
+ def test_get_accounts_with_search_criterion_search
36
+ search = Landslider::WsSearch.new
37
+ search.search_criteria = Landslider::WsSearchCriterion.new('AccountTypeId', 'Equals', '1539484')
38
+ result = Landslider.get_accounts($sesson_id1, search)
39
+
40
+ assert_not_nil result
41
+ assert_equal false, result[:error]
42
+ assert_kind_of Array, result[:accounts]
43
+ assert_equal 2, result[:accounts].size
44
+
45
+ end
46
+
47
+
48
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: landslider
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.11
5
+ version: 0.5.12
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jay Prall
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-13 00:00:00 -04:00
13
+ date: 2011-05-18 00:00:00 -04:00
14
14
  default_executable: generate_api_key.rb
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -67,6 +67,7 @@ extra_rdoc_files:
67
67
  - LICENSE
68
68
  - README.md
69
69
  files:
70
+ - .yardopts
70
71
  - Gemfile
71
72
  - HISTORY.md
72
73
  - LICENSE
@@ -114,6 +115,7 @@ files:
114
115
  - lib/landslider/entities/ws_user.rb
115
116
  - lib/landslider/entities/ws_user_search.rb
116
117
  - test/get_account_types_test.rb
118
+ - test/get_accounts_test.rb
117
119
  - test/landslider_test.rb
118
120
  - test/test_helper.rb
119
121
  - test/ws_account_note_search_test.rb
@@ -151,6 +153,7 @@ specification_version: 3
151
153
  summary: Landslide Ruby
152
154
  test_files:
153
155
  - test/get_account_types_test.rb
156
+ - test/get_accounts_test.rb
154
157
  - test/landslider_test.rb
155
158
  - test/test_helper.rb
156
159
  - test/ws_account_note_search_test.rb