vero 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vero (0.5.8)
5
- girl_friday (~> 0.11.2)
4
+ vero (0.5.9)
5
+ girl_friday (>= 0.11.2)
6
6
  json
7
7
  rest-client
8
8
 
@@ -134,7 +134,7 @@ PLATFORMS
134
134
  DEPENDENCIES
135
135
  delayed_job
136
136
  delayed_job_active_record
137
- rails (> 3)
137
+ rails (>= 3)
138
138
  resque
139
139
  rspec
140
140
  vero!
@@ -12,7 +12,7 @@ module Vero
12
12
  end
13
13
 
14
14
  def validate!
15
- raise ArgumentError.new("Missing :email") if options[:email].to_s.blank?
15
+ raise ArgumentError.new("Missing :id or :email") if options[:id].to_s.blank? && options[:email].to_s.blank?
16
16
  raise ArgumentError.new(":changes must be a Hash") unless options[:changes].is_a?(Hash)
17
17
  end
18
18
  end
@@ -12,7 +12,7 @@ module Vero
12
12
  end
13
13
 
14
14
  def validate!
15
- raise ArgumentError.new("Missing :email") if options[:email].to_s.blank?
15
+ raise ArgumentError.new("Missing :id or :email") if options[:id].to_s.blank? && options[:email].to_s.blank?
16
16
  raise ArgumentError.new(":add must an Array if present") unless options[:add].nil? || options[:add].is_a?(Array)
17
17
  raise ArgumentError.new(":remove must an Array if present") unless options[:remove].nil? || options[:remove].is_a?(Array)
18
18
  raise ArgumentError.new("Either :add or :remove must be present") if (options[:remove].nil? && options[:add].nil?)
@@ -12,7 +12,7 @@ module Vero
12
12
  end
13
13
 
14
14
  def validate!
15
- raise ArgumentError.new("Missing :email") if options[:email].to_s.blank?
15
+ raise ArgumentError.new("Missing :id or :email") if options[:id].to_s.blank? && options[:email].to_s.blank?
16
16
  raise ArgumentError.new(":data must be either nil or a Hash") unless (options[:data].nil? || options[:data].is_a?(Hash))
17
17
  end
18
18
  end
@@ -12,7 +12,7 @@ module Vero
12
12
  end
13
13
 
14
14
  def validate!
15
- raise ArgumentError.new("Missing :email") if options[:email].to_s.blank?
15
+ raise ArgumentError.new("Missing :id or :email") if options[:id].to_s.blank? && options[:email].to_s.blank?
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module Vero
2
- VERSION = '0.5.8'
2
+ VERSION = '0.5.9'
3
3
  end
@@ -16,7 +16,7 @@ describe Vero::Api::Workers::Events::TrackAPI do
16
16
  context "request with properties" do
17
17
  subject { Vero::Api::Workers::Events::TrackAPI.new('https://www.getvero.com', {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :event_name => 'test_event'}) }
18
18
  describe :validate! do
19
- it "should raise an error if test_event is a blank String" do
19
+ it "should raise an error if event_name is a blank String" do
20
20
  options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :event_name => nil}
21
21
  subject.options = options
22
22
  expect { subject.send(:validate!) }.to raise_error(ArgumentError)
@@ -46,7 +46,7 @@ describe Vero::Api::Workers::Events::TrackAPI do
46
46
  expect { subject.send(:validate!) }.to_not raise_error(ArgumentError)
47
47
  end
48
48
  end
49
-
49
+
50
50
  describe :request do
51
51
  it "should send a JSON request to the Vero API" do
52
52
  RestClient.should_receive(:post).with("https://www.getvero.com/api/v2/events/track.json", {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :event_name => 'test_event'}.to_json, {:content_type => :json, :accept => :json})
@@ -12,12 +12,20 @@ describe Vero::Api::Workers::Users::TrackAPI do
12
12
 
13
13
  subject { Vero::Api::Workers::Users::TrackAPI.new('https://www.getvero.com', {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :email => 'test@test.com'}) }
14
14
  describe :validate! do
15
- it "should raise an error if email is a blank String" do
16
- options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :email => nil}
15
+ it "should raise an error if email and id are are blank String" do
16
+ options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :id => nil, :email => nil}
17
17
  subject.options = options
18
18
  expect { subject.send(:validate!) }.to raise_error(ArgumentError)
19
19
 
20
- options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :email => 'test@test.com'}
20
+ options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :id => nil, :email => 'test@test.com'}
21
+ subject.options = options
22
+ expect { subject.send(:validate!) }.to_not raise_error(ArgumentError)
23
+
24
+ options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :id => "", :email => nil}
25
+ subject.options = options
26
+ expect { subject.send(:validate!) }.to raise_error(ArgumentError)
27
+
28
+ options = {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :id => "user123", :email => nil}
21
29
  subject.options = options
22
30
  expect { subject.send(:validate!) }.to_not raise_error(ArgumentError)
23
31
  end
@@ -42,7 +50,7 @@ describe Vero::Api::Workers::Users::TrackAPI do
42
50
  expect { subject.send(:validate!) }.to_not raise_error(ArgumentError)
43
51
  end
44
52
  end
45
-
53
+
46
54
  describe :request do
47
55
  it "should send a request to the Vero API" do
48
56
  RestClient.should_receive(:post).with("https://www.getvero.com/api/v2/users/track.json", {:auth_token => 'abcd', :identity => {:email => 'test@test.com'}, :email => 'test@test.com'}.to_json, {:content_type => :json, :accept => :json})
@@ -13,14 +13,14 @@ Gem::Specification.new do |s|
13
13
  s.authors = ['James Lamont']
14
14
 
15
15
  dependencies = [
16
- [:development, 'rails', "> 3"],
16
+ [:development, 'rails', ">= 3"],
17
17
  [:development, 'rspec'],
18
18
  [:development, 'delayed_job'],
19
19
  [:development, 'delayed_job_active_record'],
20
20
  [:development, 'resque'],
21
- [:runtime, 'json'],
22
- [:runtime, 'rest-client'],
23
- [:runtime, 'girl_friday', "~> 0.11.2"]
21
+ [:runtime, 'json'],
22
+ [:runtime, 'rest-client'],
23
+ [:runtime, 'girl_friday', ">= 0.11.2"]
24
24
  ]
25
25
 
26
26
  s.files = Dir['**/*']
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vero
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 8
10
- version: 0.5.8
9
+ - 9
10
+ version: 0.5.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Lamont
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-04-29 00:00:00 +10:00
18
+ date: 2013-05-08 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">"
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  hash: 5
30
30
  segments:
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirement: &id008 !ruby/object:Gem::Requirement
123
123
  none: false
124
124
  requirements:
125
- - - ~>
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  hash: 55
128
128
  segments: