zunnit 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/lib/zunnit/setup.rb +0 -1
- data/lib/zunnit/version.rb +1 -1
- data/spec/zunnit_spec.rb +68 -2
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/zunnit/setup.rb
CHANGED
data/lib/zunnit/version.rb
CHANGED
data/spec/zunnit_spec.rb
CHANGED
@@ -7,9 +7,75 @@ describe Zunnit do
|
|
7
7
|
describe "get" do
|
8
8
|
it "should return related items" do
|
9
9
|
zunnit = Zunnit::Api.new
|
10
|
-
response = zunnit.get(:related_items,
|
11
|
-
|
10
|
+
response = zunnit.get(:related_items,
|
11
|
+
:item_id => "20275919", :user_id => "255")
|
12
|
+
validate_response(response, :items)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should get 400 error if :item_id is not given to related items" do
|
16
|
+
zunnit = Zunnit::Api.new
|
17
|
+
response = zunnit.get(:related_items)
|
18
|
+
response[:status].should == 400
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should return recommendation items for user" do
|
22
|
+
zunnit = Zunnit::Api.new
|
23
|
+
response = zunnit.get(:recommendation_items_for_user,
|
24
|
+
:user_id => "255")
|
25
|
+
validate_response(response, :items)
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
it "should return recommendation groups for user" do
|
30
|
+
pending "404"
|
31
|
+
zunnit = Zunnit::Api.new
|
32
|
+
response = zunnit.get(:recommendation_groups_for_user,
|
33
|
+
:user_id => "255")
|
34
|
+
validate_response(response, :groups)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should return recommendation users for user" do
|
38
|
+
pending "404"
|
39
|
+
zunnit = Zunnit::Api.new
|
40
|
+
response = zunnit.get(:recommendation_groups_for_user,
|
41
|
+
:user_id => "2155")
|
42
|
+
validate_response(response, :users)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should return recommendation users for item" do
|
46
|
+
pending "It should return a collection of users but is returning items"
|
47
|
+
zunnit = Zunnit::Api.new
|
48
|
+
response = zunnit.get(:recommendation_items_for_user,
|
49
|
+
:item_id => "20275919", :user_id => "255")
|
50
|
+
validate_response(response, :users)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should return recommendation tags for item" do
|
54
|
+
pending "404"
|
55
|
+
zunnit = Zunnit::Api.new
|
56
|
+
response = zunnit.get(:recommendation_tags_for_item,
|
57
|
+
:item_id => "20275919")
|
58
|
+
validate_response(response, :tags)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should return recommendation cluster for item" do
|
62
|
+
pending "404"
|
63
|
+
zunnit = Zunnit::Api.new
|
64
|
+
response = zunnit.get(:recommendation_cluster_for_item,
|
65
|
+
:item_id => "20275919")
|
66
|
+
validate_response(response, :clusters)
|
12
67
|
end
|
13
68
|
end
|
69
|
+
|
70
|
+
describe "post" do
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
def validate_response(response, results_key)
|
76
|
+
response[:status].should == 200
|
77
|
+
response[:msg].should == "Ok"
|
78
|
+
response[results_key].size.should >= 1
|
79
|
+
end
|
14
80
|
end
|
15
81
|
|