worldpay_iadmin 1.0.1 → 1.0.2

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ worldpay_iadmin (1.0.2)
2
+
3
+ * Fixed a serious bug in iadmin_url method. Was returning test url in production mode
4
+ and production url in test mode. Added tests to prevent future mistake [Steven Cummings]
5
+
1
6
  worldpay_iadmin (1.0.1)
2
7
 
3
8
  * Fixed a bug in worldpay_iadmin_test.rb [Steven Cummings]
@@ -77,8 +77,8 @@ class WorldpayIadmin
77
77
  @worldpay_id = worldpay_id
78
78
  @password = password
79
79
  @test_mode = test_mode
80
- @production_url = "https://secure-test.wp3.rbsworldpay.com/wcc/iadmin"
81
- @test_url = "https://secure.wp3.rbsworldpay.com/wcc/iadmin"
80
+ @production_url = "https://secure.wp3.rbsworldpay.com/wcc/iadmin"
81
+ @test_url = "https://secure-test.wp3.rbsworldpay.com/wcc/iadmin"
82
82
  end
83
83
 
84
84
  # Returns the url that the command will be sent to
@@ -9,17 +9,17 @@ require 'fakeweb'
9
9
  class WorldpayIadminTest < Test::Unit::TestCase
10
10
 
11
11
  def create_worldpay_iadmin(response)
12
- @worldpay_iadmin = WorldpayIadmin.new("123434", "password")
13
- FakeWeb.register_uri(:any, @worldpay_iadmin.iadmin_url, :body => response)
14
- @worldpay_iadmin
12
+ worldpay_iadmin = WorldpayIadmin.new("123434", "password")
13
+ FakeWeb.register_uri(:any, worldpay_iadmin.iadmin_url, :body => response)
14
+ worldpay_iadmin
15
15
  end
16
16
 
17
17
  def test_initialize
18
- @worldpay_iadmin = WorldpayIadmin.new("123434", "password", true)
18
+ worldpay_iadmin = WorldpayIadmin.new("123434", "password", true)
19
19
 
20
- assert_equal "123434", @worldpay_iadmin.worldpay_id
21
- assert_equal "password", @worldpay_iadmin.password
22
- assert_equal true, @worldpay_iadmin.test_mode
20
+ assert_equal "123434", worldpay_iadmin.worldpay_id
21
+ assert_equal "password", worldpay_iadmin.password
22
+ assert_equal true, worldpay_iadmin.test_mode
23
23
  end
24
24
 
25
25
  def test_cancel_agreement
@@ -53,5 +53,15 @@ class WorldpayIadminTest < Test::Unit::TestCase
53
53
  def test_debit_fail
54
54
  assert !create_worldpay_iadmin("E,Agreement already finished").debit("232323", 9.99)
55
55
  end
56
+
57
+ def test_iadmin_url_production
58
+ worldpay_iadmin = WorldpayIadmin.new("123434", "password")
59
+ assert_equal "https://secure.wp3.rbsworldpay.com/wcc/iadmin", worldpay_iadmin.iadmin_url
60
+ end
61
+
62
+ def test_iadmin_url_test
63
+ worldpay_iadmin = WorldpayIadmin.new("123434", "password", true)
64
+ assert_equal "https://secure-test.wp3.rbsworldpay.com/wcc/iadmin", worldpay_iadmin.iadmin_url
65
+ end
56
66
 
57
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worldpay_iadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Cummings