boxnet 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/boxnet/version.rb +1 -1
- data/lib/boxnet.rb +2 -1
- data/spec/boxnet_spec.rb +12 -1
- metadata +1 -1
data/lib/boxnet/version.rb
CHANGED
data/lib/boxnet.rb
CHANGED
@@ -25,12 +25,13 @@ class Boxnet
|
|
25
25
|
def self.get_account_tree(auth_token, folder_id, options={})
|
26
26
|
params = []
|
27
27
|
params << "onelevel" if options[:onelevel]
|
28
|
+
params << "nozip" if options[:nozip]
|
28
29
|
|
29
30
|
if params.empty?
|
30
31
|
get(@@URL + "?api_key=#{@@API_KEY}&action=get_account_tree&auth_token=#{auth_token}&folder_id=#{folder_id}")
|
31
32
|
else
|
32
33
|
params_string = params.join(",")
|
33
|
-
get(@@URL + "?api_key=#{@@API_KEY}&action=get_account_tree&auth_token=#{auth_token}&folder_id=#{folder_id}¶ms=#{params_string}")
|
34
|
+
get(@@URL + "?api_key=#{@@API_KEY}&action=get_account_tree&auth_token=#{auth_token}&folder_id=#{folder_id}¶ms[]=#{params_string}")
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
data/spec/boxnet_spec.rb
CHANGED
@@ -68,7 +68,18 @@ describe Boxnet do
|
|
68
68
|
it { @result.should_not be_nil }
|
69
69
|
it { @result["response"]["status"].should == "listing_ok" }
|
70
70
|
it { @result["response"]["tree"].should_not be_nil }
|
71
|
-
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context "get no zip from root" do
|
74
|
+
before(:each) do
|
75
|
+
ticket = ENV["BOXNET_TICKET"]
|
76
|
+
auth_token = ENV["BOXNET_AUTHTOKEN"]
|
77
|
+
@result = Boxnet.get_account_tree(auth_token, "0", :nozip => true)
|
78
|
+
end
|
79
|
+
it { @result.should_not be_nil }
|
80
|
+
it { @result["response"]["status"].should == "listing_ok" }
|
81
|
+
it { @result["response"]["tree"].should_not be_nil }
|
82
|
+
end
|
72
83
|
end
|
73
84
|
|
74
85
|
end
|