zunnit 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zunnit (0.0.4)
4
+ zunnit (0.1.0)
5
5
  faraday
6
6
 
7
7
  GEM
data/lib/zunnit/setup.rb CHANGED
@@ -20,7 +20,6 @@ module Zunnit
20
20
 
21
21
  def self.setup
22
22
  self.actions = ACTIONS
23
-
24
23
  yield self
25
24
  self
26
25
  end
@@ -1,4 +1,4 @@
1
1
  module Zunnit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
4
4
 
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, {:item_id=> "20275919"})
11
- response[:status].should == 200
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
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: zunnit
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marcelo Eden