moo_moo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,197 +0,0 @@
1
- require 'spec_helper'
2
- require 'moo_moo/opensrs'
3
-
4
- module MooMoo
5
-
6
- describe OpenSRS do
7
- before(:each) do
8
- def random_domain
9
- "domainthatsnottaken#{Time.now.to_i}.com"
10
- end
11
-
12
- @opensrs = OpenSRS::Base.new
13
- @registered_domain = "domainthatsnottaken1302209138.com"
14
- @contacts = {
15
- :title => "blahblah",
16
- :owner => {
17
- :first_name => "Owen",
18
- :last_name => "Ottway",
19
- :phone => "+1.4165550123x1902",
20
- :fax => "+1.4165550124",
21
- :email => "ottway@example.com",
22
- :org_name => "Example Inc.",
23
- :address1 => "32 Oak Street",
24
- :address2 => "Suite 500",
25
- :address3 => "Owner",
26
- :city => "SomeCity",
27
- :state => "CA",
28
- :country => "US",
29
- :postal_code => "90210",
30
- :url => "http://www.example.com"
31
- },
32
- :admin => {
33
- :first_name => "Owen",
34
- :last_name => "Ottway",
35
- :phone => "+1.4165550123x1902",
36
- :fax => "+1.4165550124",
37
- :email => "ottway@example.com",
38
- :org_name => "Example Inc.",
39
- :address1 => "32 Oak Street",
40
- :address2 => "Suite 500",
41
- :address3 => "Owner",
42
- :city => "SomeCity",
43
- :state => "CA",
44
- :country => "US",
45
- :postal_code => "90210",
46
- :url => "http://www.example.com"
47
- },
48
- :billing => {
49
- :first_name => "Owen",
50
- :last_name => "Ottway",
51
- :phone => "+1.4165550123x1902",
52
- :fax => "+1.4165550124",
53
- :email => "ottway@example.com",
54
- :org_name => "Example Inc.",
55
- :address1 => "32 Oak Street",
56
- :address2 => "Suite 500",
57
- :address3 => "Owner",
58
- :city => "SomeCity",
59
- :state => "CA",
60
- :country => "US",
61
- :postal_code => "90210",
62
- :url => "http://www.example.com"
63
- },
64
- :tech => {
65
- :first_name => "Owen",
66
- :last_name => "Ottway",
67
- :phone => "+1.4165550123x1902",
68
- :fax => "+1.4165550124",
69
- :email => "ottway@example.com",
70
- :org_name => "Example Inc.",
71
- :address1 => "32 Oak Street",
72
- :address2 => "Suite 500",
73
- :address3 => "Owner",
74
- :city => "SomeCity",
75
- :state => "CA",
76
- :country => "US",
77
- :postal_code => "90210",
78
- :url => "http://www.example.com"
79
- }
80
- }
81
- end
82
-
83
- describe "TransferCommands" do
84
- describe "#cancel_transfer" do
85
- it "cancels the transfer for a domain" do
86
- VCR.use_cassette("transfer/cancel_transfer") do
87
- res = @opensrs.cancel_transfer(:domain => 'exampledomain.com', :reseller => MooMoo.config.user)
88
- res.success?.should be_false
89
- res.error_code.should == 400
90
- res.error_msg.should match(/transfer state prohibits cancellation/i)
91
- end
92
- end
93
-
94
- it "cancels the transfer for an order" do
95
- VCR.use_cassette("transfer/cancel_trasnfer_order") do
96
- res = @opensrs.cancel_transfer_for_order(:order_id => 1884820, :reseller => MooMoo.config.user)
97
- res.success?.should be_false
98
- res.error_code.should == 400
99
- res.error_msg.should match(/transfer state prohibits cancellation/i)
100
- end
101
- end
102
- end
103
-
104
- describe "#check_transfer" do
105
- it "shows in progress if the transfer is in progress" do
106
- VCR.use_cassette("transfer/check_transfer") do
107
- res = @opensrs.check_transfer('exampledomain.com')
108
- res.result['transferrable'].to_i.should == 0
109
- res.result['reason'].should match(/Transfer in progress/i)
110
- end
111
- end
112
-
113
- it "says the domain already exists if it does" do
114
- VCR.use_cassette("transfer/check_transfer_exists") do
115
- res = @opensrs.check_transfer(@registered_domain)
116
- res.result['transferrable'].to_i.should == 0
117
- res.result['reason'].should match(/Domain already exists in.*account/i)
118
- end
119
- end
120
- end
121
-
122
- describe "#get_transfers_away" do
123
- use_vcr_cassette "transfer/get_transfers_away"
124
-
125
- it "lists domains that have been transferred away" do
126
- res = @opensrs.get_transfers_away
127
- res.result['total'].to_i.should == 0
128
- end
129
- end
130
-
131
- describe "#get_tranfers_in" do
132
- use_vcr_cassette "transfer/get_transfers_in"
133
-
134
- it "lists domains that have been transferred in" do
135
- res = @opensrs.get_transfers_in
136
- res.result['total'].to_i.should == 1
137
- res.result['transfers']['0']['domain'].should == "testingdomain.com"
138
- end
139
- end
140
-
141
- describe "#process_transfer" do
142
- it "performs a new order with cancelled order's data" do
143
- VCR.use_cassette("transfer/process_transfer") do
144
- result = @opensrs.process_transfer(:order_id => 123, :reseller => MooMoo.config.user)
145
- result.success?.should be_true
146
- end
147
- end
148
-
149
- it "does not transfer if the status does not allow it" do
150
- VCR.use_cassette("transfer/process_transfer_unsuccessful") do
151
- result = @opensrs.process_transfer(:order_id => 123, :reseller => MooMoo.config.user)
152
- result.success?.should be_false
153
- result.error_code.should == 400
154
- end
155
- end
156
- end
157
-
158
- describe "#send_password (transfer)" do
159
- use_vcr_cassette "transfer/send_password"
160
-
161
- it "resends email message to admin contact" do
162
- result = @opensrs.send_password('fdsafsfsafafsaexample.com')
163
- end
164
- end
165
-
166
- describe "#push_transfer" do
167
- use_vcr_cassette "transfer/rsp2rsp_push_transfer"
168
-
169
- it "transfers the domain" do
170
- res = @opensrs.push_transfer(:domain => @registered_domain,
171
- :username => MooMoo.config.user,
172
- :password => MooMoo.config.pass,
173
- :reseller => 'opensrs')
174
- res.success?.should be_false
175
- res.error_code.should == 465
176
- res.error_msg.should match(/transfer permission denied/i)
177
- end
178
- end
179
-
180
- describe "#transfer" do
181
- use_vcr_cassette "transfer/transfer"
182
-
183
- it "initiates the transfer" do
184
- res = @opensrs.register_domain(
185
- :domain => 'testingdomain.com',
186
- :contacts => @contacts,
187
- :nameservers => ["ns1.systemdns.com", "ns2.systemdns.com"],
188
- :term => 1,
189
- :options => {:reg_type => :transfer})
190
- res.success?.should be_true
191
- res.result['id'].to_i.should == 1885789
192
- res.result['registration_text'].should match(/transfer request initiated/i)
193
- end
194
- end
195
- end
196
- end
197
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
- require 'moo_moo/opensrs'
3
-
4
- module MooMoo
5
-
6
- describe OpenSRS do
7
- before(:each) do
8
- @opensrs = OpenSRS::Base.new
9
- end
10
-
11
- end
12
- end