email_vision 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/Readme.md CHANGED
@@ -11,7 +11,7 @@ Usage
11
11
 
12
12
  emv.create :email => 'me@host.com', :foo => 1
13
13
  emv.update :email => 'me@host.com', :foo => 1
14
- emv.change_email 'me@host.com', 'you@host.com'
14
+ emv.update :email_was => 'me@host.com', :email => 'you@host.com'
15
15
 
16
16
  emv.columns
17
17
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{email_vision}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2010-07-31}
12
+ s.date = %q{2010-08-05}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.files = [
15
15
  ".gitignore",
@@ -29,10 +29,6 @@ class EmailVision
29
29
  execute_by_obj(:update_member_by_obj, attributes)
30
30
  end
31
31
 
32
- def update_email(old, new)
33
- execute(:update_member, :email => old, :field => :email, :value => new)
34
- end
35
-
36
32
  def create(attributes)
37
33
  execute_by_obj(:insert_member_by_obj, attributes)
38
34
  end
@@ -91,8 +87,9 @@ class EmailVision
91
87
  end
92
88
 
93
89
  def execute_by_obj(method, attributes)
90
+ existing_email = attributes.delete(:email_was) || attributes[:email]
94
91
  entries = attributes.map{|k,v| {:entry => {:key => k, :value => v}}}
95
- execute(method, :member => {:email => attributes[:email], :dynContent => entries})
92
+ execute(method, :member => {:email => existing_email, :dynContent => entries})
96
93
  end
97
94
 
98
95
  def execute(method, options={})
@@ -21,7 +21,7 @@ describe "EmailVision" do
21
21
  def reset_email
22
22
  email = client.find(changeable_user[:member_id])[:email]
23
23
  wait_for_job_to_finish do
24
- client.update_email(email, changeable_user[:email])
24
+ client.update(:email_was => email, :email => changeable_user[:email])
25
25
  end
26
26
  email = client.find(changeable_user[:member_id])[:email]
27
27
  email.should == changeable_user[:email]
@@ -83,18 +83,16 @@ describe "EmailVision" do
83
83
  job_id = client.update(:email => changeable_user[:email], :firstname => random_value)
84
84
  client.job_status(job_id).should == 'Insert'
85
85
  end
86
- end
87
-
88
- describe :update_email do
89
- after do
90
- reset_email
91
- end
92
86
 
93
87
  it "updates the email" do
94
- wait_for_job_to_finish do
95
- client.update_email(changeable_user[:email], email)
88
+ begin
89
+ wait_for_job_to_finish do
90
+ client.update(:email_was => changeable_user[:email], :email => email)
91
+ end
92
+ client.find(email)[:email].should == email
93
+ ensure
94
+ reset_email
96
95
  end
97
- client.find(email)[:email].should == email
98
96
  end
99
97
  end
100
98
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-31 00:00:00 +02:00
17
+ date: 2010-08-05 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency