reward_station 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -146,6 +146,7 @@ module RewardStation
146
146
  raise InvalidAccount if error_message.start_with?("Invalid Account Number")
147
147
  raise InvalidUser if error_message.start_with?("Invalid User")
148
148
  raise UserAlreadyExists if error_message.start_with?("User Name:") && error_message.end_with?("Please enter a different user name.")
149
+ raise MissingInformation if error_message.start_with?("The following information is missing:")
149
150
  end
150
151
 
151
152
  result
@@ -24,6 +24,7 @@ module RewardStation
24
24
  class InvalidToken < StandardError; end
25
25
  class InvalidUser < StandardError; end
26
26
  class UserAlreadyExists < StandardError; end
27
+ class MissingInformation < StandardError; end
27
28
 
28
29
  class ConnectionError < StandardError
29
30
  include NestingError
@@ -0,0 +1,9 @@
1
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
2
+ <soap:Body>
3
+ <UpdateUserResponse xmlns="http://rswebservices.rewardstation.com/">
4
+ <UpdateUserResult>
5
+ <ErrorMessage>The following information is missing: First Name; Last Name;</ErrorMessage>
6
+ </UpdateUserResult>
7
+ </UpdateUserResponse>
8
+ </soap:Body>
9
+ </soap:Envelope>
@@ -1,3 +1,3 @@
1
1
  module RewardStation
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -236,6 +236,17 @@ describe RewardStation::Client do
236
236
  end
237
237
  end
238
238
 
239
+ describe "create_user" do
240
+ describe 'missing information' do
241
+
242
+ before { savon.stub(:update_user).and_return(:create_user_missing_info) }
243
+
244
+ it "should raise MissingInformation error" do
245
+ lambda { service.create_user :organization_id => '150' }.should raise_error(RewardStation::MissingInformation)
246
+ end
247
+ end
248
+ end
249
+
239
250
  describe "update_user" do
240
251
  let(:service) { RewardStation::Client.new :client_id => '100080', :client_password => 'fM6Rv4moz#', :organization_id => '150', :token => "e285e1ed-2356-4676-a554-99d79e6284b0" }
241
252
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reward_station
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stepan Filatov
@@ -16,12 +16,10 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-07-19 00:00:00 +04:00
19
+ date: 2011-07-20 00:00:00 +04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- name: savon
24
- prerelease: false
25
23
  requirement: &id001 !ruby/object:Gem::Requirement
26
24
  none: false
27
25
  requirements:
@@ -33,11 +31,11 @@ dependencies:
33
31
  - 9
34
32
  - 6
35
33
  version: 0.9.6
34
+ name: savon
35
+ prerelease: false
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
39
- name: ruby-saml-bekk
40
- prerelease: false
41
39
  requirement: &id002 !ruby/object:Gem::Requirement
42
40
  none: false
43
41
  requirements:
@@ -49,6 +47,8 @@ dependencies:
49
47
  - 3
50
48
  - 3
51
49
  version: 0.3.3
50
+ name: ruby-saml-bekk
51
+ prerelease: false
52
52
  type: :runtime
53
53
  version_requirements: *id002
54
54
  description: ""
@@ -75,6 +75,7 @@ files:
75
75
  - lib/reward_station/responses/award_points_invalid_token.xml
76
76
  - lib/reward_station/responses/create_user.xml
77
77
  - lib/reward_station/responses/create_user_exists.xml
78
+ - lib/reward_station/responses/create_user_missing_info.xml
78
79
  - lib/reward_station/responses/return_point_summary.xml
79
80
  - lib/reward_station/responses/return_point_summary_invalid_token.xml
80
81
  - lib/reward_station/responses/return_popular_products.xml