cardconnect 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +35 -0
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +17 -1
  5. data/cardconnect.gemspec +1 -4
  6. data/lib/cardconnect/connection.rb +3 -3
  7. data/lib/cardconnect/services/authorization/authorization_response.rb +1 -1
  8. data/lib/cardconnect/services/inquire/inquire_response.rb +1 -1
  9. data/lib/cardconnect/version.rb +1 -1
  10. data/test/api_response_stubs.rb +2 -0
  11. data/test/cardconnect/configuration_test.rb +5 -5
  12. data/test/cardconnect/connection_test.rb +6 -6
  13. data/test/cardconnect/services/authorization/authorization_request_test.rb +35 -35
  14. data/test/cardconnect/services/authorization/authorization_response_test.rb +19 -19
  15. data/test/cardconnect/services/authorization/authorization_test.rb +11 -11
  16. data/test/cardconnect/services/bin/bin_request_test.rb +6 -6
  17. data/test/cardconnect/services/bin/bin_response_test.rb +13 -13
  18. data/test/cardconnect/services/bin/bin_test.rb +9 -9
  19. data/test/cardconnect/services/capture/capture_request_test.rb +11 -11
  20. data/test/cardconnect/services/capture/capture_response_test.rb +6 -6
  21. data/test/cardconnect/services/capture/capture_test.rb +9 -9
  22. data/test/cardconnect/services/inquire/inquire_request_test.rb +6 -6
  23. data/test/cardconnect/services/inquire/inquire_response_test.rb +17 -17
  24. data/test/cardconnect/services/inquire/inquire_test.rb +9 -9
  25. data/test/cardconnect/services/profile/profile_delete_request_test.rb +7 -7
  26. data/test/cardconnect/services/profile/profile_delete_response_test.rb +11 -11
  27. data/test/cardconnect/services/profile/profile_get_request_test.rb +7 -7
  28. data/test/cardconnect/services/profile/profile_get_response_test.rb +28 -28
  29. data/test/cardconnect/services/profile/profile_put_request_test.rb +23 -23
  30. data/test/cardconnect/services/profile/profile_put_response_test.rb +28 -28
  31. data/test/cardconnect/services/profile/profile_test.rb +27 -27
  32. data/test/cardconnect/services/refund/refund_request_test.rb +7 -7
  33. data/test/cardconnect/services/refund/refund_response_test.rb +13 -13
  34. data/test/cardconnect/services/refund/refund_test.rb +9 -9
  35. data/test/cardconnect/services/settlement_status/settlement_status_request_test.rb +12 -12
  36. data/test/cardconnect/services/settlement_status/settlement_status_response_test.rb +8 -8
  37. data/test/cardconnect/services/settlement_status/settlement_status_test.rb +9 -9
  38. data/test/cardconnect/services/void/void_request_test.rb +7 -7
  39. data/test/cardconnect/services/void/void_response_test.rb +14 -14
  40. data/test/cardconnect/services/void/void_test.rb +9 -9
  41. data/test/cardconnect_test.rb +2 -2
  42. data/test/test_helper.rb +1 -1
  43. metadata +9 -38
  44. data/.travis.yml +0 -10
@@ -11,57 +11,57 @@ describe CardConnect::Service::BinResponse do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have country' do
14
- @response.country.must_equal 'USA'
14
+ _(@response.country).must_equal 'USA'
15
15
  end
16
16
 
17
17
  it 'should have product' do
18
- @response.product.must_equal 'V'
18
+ _(@response.product).must_equal 'V'
19
19
  end
20
20
 
21
21
  it 'should have cardusestring' do
22
- @response.cardusestring.must_equal 'True credit'
22
+ _(@response.cardusestring).must_equal 'True credit'
23
23
  end
24
24
 
25
25
  it 'should have gsa' do
26
- @response.gsa.must_equal false
26
+ _(@response.gsa).must_equal false
27
27
  end
28
28
 
29
29
  it 'should have corporate' do
30
- @response.corporate.must_equal true
30
+ _(@response.corporate).must_equal true
31
31
  end
32
32
 
33
33
  it 'should have fsa' do
34
- @response.fsa.must_equal false
34
+ _(@response.fsa).must_equal false
35
35
  end
36
36
 
37
37
  it 'should have subtype' do
38
- @response.subtype.must_equal 'Visa Corporate T&E'
38
+ _(@response.subtype).must_equal 'Visa Corporate T&E'
39
39
  end
40
40
 
41
41
  it 'should have purchase' do
42
- @response.purchase.must_equal false
42
+ _(@response.purchase).must_equal false
43
43
  end
44
44
 
45
45
  it 'should have prepaid' do
46
- @response.prepaid.must_equal false
46
+ _(@response.prepaid).must_equal false
47
47
  end
48
48
 
49
49
  it 'should have binlo' do
50
- @response.binlo.must_equal '478823XXX'
50
+ _(@response.binlo).must_equal '478823XXX'
51
51
  end
52
52
 
53
53
  it 'should have issuer' do
54
- @response.issuer.must_equal "JPMorgan Chase Bank N.A. - Commercial"
54
+ _(@response.issuer).must_equal "JPMorgan Chase Bank N.A. - Commercial"
55
55
  end
56
56
 
57
57
  it 'should have binhi' do
58
- @response.binhi.must_equal "478825XXX"
58
+ _(@response.binhi).must_equal "478825XXX"
59
59
  end
60
60
  end
61
61
 
62
62
  describe '#body' do
63
63
  it 'should generate hash with all the right values' do
64
- @response.body.must_equal symbolize_keys(valid_bin_response)
64
+ _(@response.body).must_equal symbolize_keys(valid_bin_response)
65
65
  end
66
66
  end
67
67
  end
@@ -14,7 +14,7 @@ describe CardConnect::Service::Bin do
14
14
  end
15
15
 
16
16
  it 'must have the right path' do
17
- @service.path.must_equal '/cardconnect/rest/bin'
17
+ _(@service.path).must_equal '/cardconnect/rest/bin'
18
18
  end
19
19
 
20
20
  describe '#build_request' do
@@ -29,28 +29,28 @@ describe CardConnect::Service::Bin do
29
29
  it 'creates a bin request object with the passed in params' do
30
30
  @service.build_request(@valid_params)
31
31
 
32
- @service.request.must_be_kind_of CardConnect::Service::BinRequest
33
- @service.request.token.must_equal '9477709629051443'
34
- @service.request.merchid.must_equal '000000927996'
32
+ _(@service.request).must_be_kind_of CardConnect::Service::BinRequest
33
+ _(@service.request.token).must_equal '9477709629051443'
34
+ _(@service.request.merchid).must_equal '000000927996'
35
35
  end
36
36
 
37
37
  it 'uses default merchant ID if merchid is not passed in' do
38
38
  @service.build_request(@valid_params.reject! { |k, _| k == 'merchid' })
39
- @service.request.must_be_kind_of CardConnect::Service::BinRequest
40
- @service.request.merchid.must_equal 'merchant123'
39
+ _(@service.request).must_be_kind_of CardConnect::Service::BinRequest
40
+ _(@service.request.merchid).must_equal 'merchant123'
41
41
  end
42
42
  end
43
43
 
44
44
  describe '#submit' do
45
45
  it 'raises an error when there is no request' do
46
- @service.request.nil?.must_equal true
47
- proc { @service.submit }.must_raise CardConnect::Error
46
+ _(@service.request.nil?).must_equal true
47
+ _(-> { @service.submit }).must_raise CardConnect::Error
48
48
  end
49
49
 
50
50
  it 'creates a response when a valid request is processed' do
51
51
  @service.build_request(valid_bin_request)
52
52
  @service.submit
53
- @service.response.must_be_kind_of CardConnect::Service::BinResponse
53
+ _(@service.response).must_be_kind_of CardConnect::Service::BinResponse
54
54
  end
55
55
  end
56
56
  end
@@ -11,55 +11,55 @@ describe CardConnect::Service::CaptureRequest do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have merchant id' do
14
- @request.merchid.must_equal '000000927996'
14
+ _(@request.merchid).must_equal '000000927996'
15
15
  end
16
16
 
17
17
  it 'should have retrieval reference number' do
18
- @request.retref.must_equal '288002073633'
18
+ _(@request.retref).must_equal '288002073633'
19
19
  end
20
20
 
21
21
  it 'should have authorization code' do
22
- @request.authcode.must_equal '046221'
22
+ _(@request.authcode).must_equal '046221'
23
23
  end
24
24
 
25
25
  it 'should have amount' do
26
- @request.amount.must_equal '596.00'
26
+ _(@request.amount).must_equal '596.00'
27
27
  end
28
28
 
29
29
  it 'should have invoice id' do
30
- @request.invoiceid.must_equal '7890'
30
+ _(@request.invoiceid).must_equal '7890'
31
31
  end
32
32
 
33
33
  it 'should have PO number' do
34
- @request.ponumber.must_equal 'PO-0736332'
34
+ _(@request.ponumber).must_equal 'PO-0736332'
35
35
  end
36
36
 
37
37
  it 'should have tax amount' do
38
- @request.taxamnt.must_equal '40.00'
38
+ _(@request.taxamnt).must_equal '40.00'
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#valid?' do
43
43
  it 'should not be valid if no attributes are passed in' do
44
- CardConnect::Service::CaptureRequest.new.valid?.must_equal false
44
+ _(CardConnect::Service::CaptureRequest.new.valid?).must_equal false
45
45
  end
46
46
 
47
47
  it 'should be valid if valid attributes are passed in' do
48
- CardConnect::Service::CaptureRequest.new(valid_capture_request).valid?.must_equal true
48
+ _(CardConnect::Service::CaptureRequest.new(valid_capture_request).valid?).must_equal true
49
49
  end
50
50
  end
51
51
 
52
52
  describe '#errors' do
53
53
  CardConnect::Service::CaptureRequest::REQUIRED_FIELDS.each do |field|
54
54
  it "should have an error message if #{field} is missing" do
55
- CardConnect::Service::CaptureRequest.new.errors.must_include "#{field.to_s.capitalize} is missing"
55
+ _(CardConnect::Service::CaptureRequest.new.errors).must_include "#{field.to_s.capitalize} is missing"
56
56
  end
57
57
  end
58
58
  end
59
59
 
60
60
  describe '#payload' do
61
61
  it 'should generate hash with all the right values' do
62
- @request.payload.must_equal symbolize_keys(valid_capture_request)
62
+ _(@request.payload).must_equal symbolize_keys(valid_capture_request)
63
63
  end
64
64
  end
65
65
  end
@@ -11,29 +11,29 @@ describe CardConnect::Service::CaptureResponse do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have merchant id' do
14
- @response.merchid.must_equal '000000927996'
14
+ _(@response.merchid).must_equal '000000927996'
15
15
  end
16
16
 
17
17
  it 'should have account' do
18
- @response.account.must_equal '41XXXXXXXXXX4113'
18
+ _(@response.account).must_equal '41XXXXXXXXXX4113'
19
19
  end
20
20
 
21
21
  it 'should have amount' do
22
- @response.amount.must_equal '596.00'
22
+ _(@response.amount).must_equal '596.00'
23
23
  end
24
24
 
25
25
  it 'should have retrieval reference number' do
26
- @response.retref.must_equal '288002073633'
26
+ _(@response.retref).must_equal '288002073633'
27
27
  end
28
28
 
29
29
  it 'should have settlement status' do
30
- @response.setlstat.must_equal 'Pending'
30
+ _(@response.setlstat).must_equal 'Pending'
31
31
  end
32
32
  end
33
33
 
34
34
  describe '#body' do
35
35
  it 'should generate hash with all the right values' do
36
- @response.body.must_equal symbolize_keys(valid_capture_response)
36
+ _(@response.body).must_equal symbolize_keys(valid_capture_response)
37
37
  end
38
38
  end
39
39
  end
@@ -13,7 +13,7 @@ describe CardConnect::Service::Capture do
13
13
  end
14
14
 
15
15
  it 'must have the right path' do
16
- @service.path.must_equal '/cardconnect/rest/capture'
16
+ _(@service.path).must_equal '/cardconnect/rest/capture'
17
17
  end
18
18
 
19
19
  describe '#build_request' do
@@ -28,29 +28,29 @@ describe CardConnect::Service::Capture do
28
28
  it 'creates a Capture request object with the passed in params' do
29
29
  @service.build_request(@valid_params)
30
30
 
31
- @service.request.must_be_kind_of CardConnect::Service::CaptureRequest
31
+ _(@service.request).must_be_kind_of CardConnect::Service::CaptureRequest
32
32
 
33
- @service.request.merchid.must_equal '000000927996'
34
- @service.request.retref.must_equal '288002073633'
33
+ _(@service.request.merchid).must_equal '000000927996'
34
+ _(@service.request.retref).must_equal '288002073633'
35
35
  end
36
36
 
37
37
  it 'uses default merchant ID if merchid is not passed in' do
38
38
  @service.build_request(@valid_params.reject! { |k, _| k == 'merchid' })
39
- @service.request.must_be_kind_of CardConnect::Service::CaptureRequest
40
- @service.request.merchid.must_equal 'merchant123'
39
+ _(@service.request).must_be_kind_of CardConnect::Service::CaptureRequest
40
+ _(@service.request.merchid).must_equal 'merchant123'
41
41
  end
42
42
  end
43
43
 
44
44
  describe '#submit' do
45
45
  it 'raises an error when there is no request' do
46
- @service.request.nil?.must_equal true
47
- proc { @service.submit }.must_raise CardConnect::Error
46
+ _(@service.request.nil?).must_equal true
47
+ _(proc { @service.submit }).must_raise CardConnect::Error
48
48
  end
49
49
 
50
50
  it 'creates a response when a valid request is processed' do
51
51
  @service.build_request(valid_capture_request)
52
52
  @service.submit
53
- @service.response.must_be_kind_of CardConnect::Service::CaptureResponse
53
+ _(@service.response).must_be_kind_of CardConnect::Service::CaptureResponse
54
54
  end
55
55
  end
56
56
  end
@@ -11,35 +11,35 @@ describe CardConnect::Service::InquireRequest do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have merchant id' do
14
- @request.merchid.must_equal '000000927996'
14
+ _(@request.merchid).must_equal '000000927996'
15
15
  end
16
16
 
17
17
  it 'should have retrieval reference number' do
18
- @request.retref.must_equal '288002073633'
18
+ _(@request.retref).must_equal '288002073633'
19
19
  end
20
20
  end
21
21
 
22
22
  describe '#valid?' do
23
23
  it 'should not be valid if no attributes are passed in' do
24
- CardConnect::Service::InquireRequest.new.valid?.must_equal false
24
+ _(CardConnect::Service::InquireRequest.new.valid?).must_equal false
25
25
  end
26
26
 
27
27
  it 'should be valid if valid attributes are passed in' do
28
- CardConnect::Service::InquireRequest.new(valid_inquire_request).valid?.must_equal true
28
+ _(CardConnect::Service::InquireRequest.new(valid_inquire_request).valid?).must_equal true
29
29
  end
30
30
  end
31
31
 
32
32
  describe '#errors' do
33
33
  CardConnect::Service::InquireRequest::REQUIRED_FIELDS.each do |field|
34
34
  it "should have an error message if #{field} is missing" do
35
- CardConnect::Service::InquireRequest.new.errors.must_include "#{field.to_s.capitalize} is missing"
35
+ _(CardConnect::Service::InquireRequest.new.errors).must_include "#{field.to_s.capitalize} is missing"
36
36
  end
37
37
  end
38
38
  end
39
39
 
40
40
  describe '#payload' do
41
41
  it 'should generate the correct path params' do
42
- @request.payload.must_equal '/288002073633/000000927996'
42
+ _(@request.payload).must_equal '/288002073633/000000927996'
43
43
  end
44
44
  end
45
45
  end
@@ -11,73 +11,73 @@ describe CardConnect::Service::InquireResponse do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have merchant id' do
14
- @response.merchid.must_equal '000000927996'
14
+ _(@response.merchid).must_equal '000000927996'
15
15
  end
16
16
 
17
17
  it 'should have name' do
18
- @response.name.must_equal 'TOM JONES'
18
+ _(@response.name).must_equal 'TOM JONES'
19
19
  end
20
20
 
21
21
  it 'should have account' do
22
- @response.account.must_equal '9418594164541111'
22
+ _(@response.account).must_equal '9418594164541111'
23
23
  end
24
24
 
25
25
  it 'should have amount' do
26
- @response.amount.must_equal '596.00'
26
+ _(@response.amount).must_equal '596.00'
27
27
  end
28
28
 
29
29
  it 'should have currency' do
30
- @response.currency.must_equal 'USD'
30
+ _(@response.currency).must_equal 'USD'
31
31
  end
32
32
 
33
33
  it 'should have retrieval reference number' do
34
- @response.retref.must_equal '288015190411'
34
+ _(@response.retref).must_equal '288015190411'
35
35
  end
36
36
 
37
37
  it 'should have response code' do
38
- @response.respcode.must_equal '00'
38
+ _(@response.respcode).must_equal '00'
39
39
  end
40
40
 
41
41
  it 'should have response processor' do
42
- @response.respproc.must_equal 'FNOR'
42
+ _(@response.respproc).must_equal 'FNOR'
43
43
  end
44
44
 
45
45
  it 'should have response status' do
46
- @response.respstat.must_equal 'A'
46
+ _(@response.respstat).must_equal 'A'
47
47
  end
48
48
 
49
49
  it 'should have capture status' do
50
- @response.resptext.must_equal 'Approval'
50
+ _(@response.resptext).must_equal 'Approval'
51
51
  end
52
52
 
53
53
  it 'should have settlement status' do
54
- @response.setlstat.must_equal 'Accepted'
54
+ _(@response.setlstat).must_equal 'Accepted'
55
55
  end
56
56
 
57
57
  it 'should have token' do
58
- @response.token.must_equal '9418594164541111'
58
+ _(@response.token).must_equal '9418594164541111'
59
59
  end
60
60
 
61
61
  it 'should have authdate' do
62
- @response.authdate.must_equal '20180410'
62
+ _(@response.authdate).must_equal '20180410'
63
63
  end
64
64
 
65
65
  it 'should have captureddate' do
66
- @response.capturedate.must_equal '20180326065748'
66
+ _(@response.capturedate).must_equal '20180326065748'
67
67
  end
68
68
 
69
69
  it 'should have lastfour value' do
70
- @response.lastfour.must_equal '1111'
70
+ _(@response.lastfour).must_equal '1111'
71
71
  end
72
72
 
73
73
  it 'should have settledate' do
74
- @response.settledate.must_equal '20180327143721'
74
+ _(@response.settledate).must_equal '20180327143721'
75
75
  end
76
76
  end
77
77
 
78
78
  describe '#body' do
79
79
  it 'should generate hash with all the right values' do
80
- @response.body.must_equal symbolize_keys(valid_inquire_response)
80
+ _(@response.body).must_equal symbolize_keys(valid_inquire_response)
81
81
  end
82
82
  end
83
83
  end
@@ -14,7 +14,7 @@ describe CardConnect::Service::Inquire do
14
14
  end
15
15
 
16
16
  it 'must have the right path' do
17
- @service.path.must_equal '/cardconnect/rest/inquire'
17
+ _(@service.path).must_equal '/cardconnect/rest/inquire'
18
18
  end
19
19
 
20
20
  describe '#build_request' do
@@ -29,28 +29,28 @@ describe CardConnect::Service::Inquire do
29
29
  it 'creates a inquire request object with the passed in params' do
30
30
  @service.build_request(@valid_params)
31
31
 
32
- @service.request.must_be_kind_of CardConnect::Service::InquireRequest
33
- @service.request.retref.must_equal '288002073633'
34
- @service.request.merchid.must_equal '000000927996'
32
+ _(@service.request).must_be_kind_of CardConnect::Service::InquireRequest
33
+ _(@service.request.retref).must_equal '288002073633'
34
+ _(@service.request.merchid).must_equal '000000927996'
35
35
  end
36
36
 
37
37
  it 'uses default merchant ID if merchid is not passed in' do
38
38
  @service.build_request(@valid_params.reject! { |k, _| k == 'merchid' })
39
- @service.request.must_be_kind_of CardConnect::Service::InquireRequest
40
- @service.request.merchid.must_equal 'merchant123'
39
+ _(@service.request).must_be_kind_of CardConnect::Service::InquireRequest
40
+ _(@service.request.merchid).must_equal 'merchant123'
41
41
  end
42
42
  end
43
43
 
44
44
  describe '#submit' do
45
45
  it 'raises an error when there is no request' do
46
- @service.request.nil?.must_equal true
47
- proc { @service.submit }.must_raise CardConnect::Error
46
+ _(@service.request.nil?).must_equal true
47
+ _(proc { @service.submit }).must_raise CardConnect::Error
48
48
  end
49
49
 
50
50
  it 'creates a response when a valid request is processed' do
51
51
  @service.build_request(valid_inquire_request)
52
52
  @service.submit
53
- @service.response.must_be_kind_of CardConnect::Service::InquireResponse
53
+ _(@service.response).must_be_kind_of CardConnect::Service::InquireResponse
54
54
  end
55
55
  end
56
56
  end
@@ -11,25 +11,25 @@ describe CardConnect::Service::ProfileDeleteRequest do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have merchant id' do
14
- @request.merchid.must_equal '000000927996'
14
+ _(@request.merchid).must_equal '000000927996'
15
15
  end
16
16
 
17
17
  it 'should have profile id' do
18
- @request.profileid.must_equal '12345678901234567890'
18
+ _(@request.profileid).must_equal '12345678901234567890'
19
19
  end
20
20
 
21
21
  it 'should have account id' do
22
- @request.acctid.must_equal '1'
22
+ _(@request.acctid).must_equal '1'
23
23
  end
24
24
  end
25
25
 
26
26
  describe '#valid?' do
27
27
  it 'should not be valid if no attributes are passed in' do
28
- CardConnect::Service::ProfileDeleteRequest.new.valid?.must_equal false
28
+ _(CardConnect::Service::ProfileDeleteRequest.new.valid?).must_equal false
29
29
  end
30
30
 
31
31
  it 'should be valid if valid attributes are passed in' do
32
- CardConnect::Service::ProfileDeleteRequest.new(valid_profile_request).valid?.must_equal true
32
+ _(CardConnect::Service::ProfileDeleteRequest.new(valid_profile_request).valid?).must_equal true
33
33
  end
34
34
  end
35
35
 
@@ -37,14 +37,14 @@ describe CardConnect::Service::ProfileDeleteRequest do
37
37
  CardConnect::Service::ProfileDeleteRequest::REQUIRED_FIELDS.each do |field|
38
38
  field_name = field.to_s.capitalize
39
39
  it "should have an error message if #{field_name} is missing" do
40
- CardConnect::Service::ProfileDeleteRequest.new.errors.must_include "#{field_name} is missing"
40
+ _(CardConnect::Service::ProfileDeleteRequest.new.errors).must_include "#{field_name} is missing"
41
41
  end
42
42
  end
43
43
  end
44
44
 
45
45
  describe '#payload' do
46
46
  it 'should generate hash with all the right values' do
47
- @request.payload.must_equal "/12345678901234567890/1/000000927996"
47
+ _(@request.payload).must_equal "/12345678901234567890/1/000000927996"
48
48
  end
49
49
  end
50
50
  end
@@ -11,57 +11,57 @@ describe CardConnect::Service::ProfileDeleteResponse do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have response text' do
14
- @response.resptext.must_equal 'Profile Deleted'
14
+ _(@response.resptext).must_equal 'Profile Deleted'
15
15
  end
16
16
 
17
17
  it 'should have the response code' do
18
- @response.respcode.must_equal '08'
18
+ _(@response.respcode).must_equal '08'
19
19
  end
20
20
 
21
21
  it 'should have the respproc' do
22
- @response.respproc.must_equal 'PPS'
22
+ _(@response.respproc).must_equal 'PPS'
23
23
  end
24
24
 
25
25
  it 'should have response status' do
26
- @response.respstat.must_equal 'A'
26
+ _(@response.respstat).must_equal 'A'
27
27
  end
28
28
 
29
29
  it 'should have profileid' do
30
- @response.profileid.must_equal '12345678901234567890'
30
+ _(@response.profileid).must_equal '12345678901234567890'
31
31
  end
32
32
 
33
33
  it 'should have acctid' do
34
- @response.acctid.must_equal '1'
34
+ _(@response.acctid).must_equal '1'
35
35
  end
36
36
  end
37
37
 
38
38
  describe '#success?' do
39
39
  it 'should be true when there are no errors' do
40
- @response.success?.must_equal true
40
+ _(@response.success?).must_equal true
41
41
  end
42
42
 
43
43
  it 'should be false when there are errors' do
44
44
  prof_response = valid_profile_delete_response.merge!('respstat' => 'C', 'resptext' => 'this is an error')
45
45
  response = CardConnect::Service::ProfileDeleteResponse.new(prof_response)
46
- response.success?.must_equal false
46
+ _(response.success?).must_equal false
47
47
  end
48
48
  end
49
49
 
50
50
  describe '#errors' do
51
51
  it 'should be empty when there are no errors' do
52
- @response.errors.must_be_empty
52
+ _(@response.errors).must_be_empty
53
53
  end
54
54
 
55
55
  it 'should be an array of error messages when there are errors' do
56
56
  prof_response = valid_profile_delete_response.merge!('respstat' => 'C', 'resptext' => 'this is an error')
57
57
  response = CardConnect::Service::ProfileDeleteResponse.new(prof_response)
58
- response.errors.must_equal ['this is an error']
58
+ _(response.errors).must_equal ['this is an error']
59
59
  end
60
60
  end
61
61
 
62
62
  describe '#body' do
63
63
  it 'should generate hash with all the right values' do
64
- @response.body.must_equal symbolize_keys(valid_profile_delete_response)
64
+ _(@response.body).must_equal symbolize_keys(valid_profile_delete_response)
65
65
  end
66
66
  end
67
67
  end
@@ -11,25 +11,25 @@ describe CardConnect::Service::ProfileGetRequest do
11
11
 
12
12
  describe 'FIELDS' do
13
13
  it 'should have merchant id' do
14
- @request.merchid.must_equal '000000927996'
14
+ _(@request.merchid).must_equal '000000927996'
15
15
  end
16
16
 
17
17
  it 'should have profile id' do
18
- @request.profileid.must_equal '12345678901234567890'
18
+ _(@request.profileid).must_equal '12345678901234567890'
19
19
  end
20
20
 
21
21
  it 'should have account id' do
22
- @request.acctid.must_equal '1'
22
+ _(@request.acctid).must_equal '1'
23
23
  end
24
24
  end
25
25
 
26
26
  describe '#valid?' do
27
27
  it 'should not be valid if no attributes are passed in' do
28
- CardConnect::Service::ProfileGetRequest.new.valid?.must_equal false
28
+ _(CardConnect::Service::ProfileGetRequest.new.valid?).must_equal false
29
29
  end
30
30
 
31
31
  it 'should be valid if valid attributes are passed in' do
32
- CardConnect::Service::ProfileGetRequest.new(valid_profile_request).valid?.must_equal true
32
+ _(CardConnect::Service::ProfileGetRequest.new(valid_profile_request).valid?).must_equal true
33
33
  end
34
34
  end
35
35
 
@@ -37,14 +37,14 @@ describe CardConnect::Service::ProfileGetRequest do
37
37
  CardConnect::Service::ProfileGetRequest::REQUIRED_FIELDS.each do |field|
38
38
  field_name = field.to_s.capitalize
39
39
  it "should have an error message if #{field_name} is missing" do
40
- CardConnect::Service::ProfileGetRequest.new.errors.must_include "#{field_name} is missing"
40
+ _(CardConnect::Service::ProfileGetRequest.new.errors).must_include "#{field_name} is missing"
41
41
  end
42
42
  end
43
43
  end
44
44
 
45
45
  describe '#payload' do
46
46
  it 'should generate hash with all the right values' do
47
- @request.payload.must_equal "/12345678901234567890/1/000000927996"
47
+ _(@request.payload).must_equal "/12345678901234567890/1/000000927996"
48
48
  end
49
49
  end
50
50
  end