salesflip-jobboersen_integration 0.3.0 → 0.3.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.
@@ -41,7 +41,8 @@ module ContactExtras
41
41
  def tjb_xml
42
42
  password = generate_password
43
43
  { :first_name => self.first_name, :last_name => self.last_name, :email => self.email,
44
- :password => password, :password_confirmation => password }.to_xml(:root => 'contact')
44
+ :password => password, :password_confirmation => password,
45
+ :account_id => self.account.tjb_id }.to_xml(:root => 'contact')
45
46
  end
46
47
 
47
48
  def generate_password
@@ -19,7 +19,7 @@ module JobboersenIntegration
19
19
  Salesflip::Plugin.register(:jobboersen_integration) do
20
20
  name 'JobBoersen Integration'
21
21
  author 'Matt Beedle'
22
- version '0.3.0'
22
+ version '0.3.1'
23
23
  description 'Everything to seemlessly integrate 1000jobboersen.de'
24
24
  end
25
25
 
@@ -23,5 +23,8 @@ Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require File.basename(file)
23
23
  class ActiveSupport::TestCase
24
24
  setup do
25
25
  FakeWeb.allow_net_connect = false
26
+ Contact.send(:include, ContactExtras)
27
+ Account.send(:include, AccountExtras)
28
+ User.send(:include, UserExtras)
26
29
  end
27
30
  end
@@ -2,7 +2,6 @@ require 'test_helper'
2
2
 
3
3
  class AccountTest < ActiveSupport::TestCase
4
4
  setup do
5
- Account.send(:include, AccountExtras)
6
5
  @user = User.create :email => 'test@test.com', :tjb_auth_token => 'La9Hbm8SnPJN-F-zUhlp'
7
6
  end
8
7
 
@@ -7,7 +7,6 @@ class ContactTest < ActiveSupport::TestCase
7
7
  :body => File.read('test/support/account_create_success.xml'))
8
8
  FakeWeb.register_uri(:post, 'http://1000jobboersen.de/administration/administrators.xml',
9
9
  :body => File.read('test/support/administrator_create_success.xml'))
10
- Contact.send(:include, ContactExtras)
11
10
  @user = User.create :email => 'test@test.com', :tjb_auth_token => 'La9Hbm8SnPJN-F-zUhlp'
12
11
  @account = Account.create :name => 'test account', :user => @user
13
12
  end
@@ -30,13 +29,14 @@ class ContactTest < ActiveSupport::TestCase
30
29
  :account => @account, :user => @user
31
30
  end
32
31
 
33
- should 'only send first_name, last_name, email, password and password_confirmation in xml' do
32
+ should 'only send first_name, last_name, email, password, password_confirmation and account_id in xml' do
34
33
  assert_match(/first\-name/, @contact.tjb_xml)
35
34
  assert_match(/last\-name/, @contact.tjb_xml)
36
35
  assert_match(/email/, @contact.tjb_xml)
37
36
  assert_match(/password/, @contact.tjb_xml)
38
37
  assert_match(/password\-confirmation/, @contact.tjb_xml)
39
38
  assert_no_match(/another\-field/, @contact.tjb_xml)
39
+ assert_match(/account\-id/, @contact.tjb_xml)
40
40
  end
41
41
 
42
42
  should 'set the tjb_id when the contact has been created in 1000jobboersen' do
@@ -1,10 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class UserTest < ActiveSupport::TestCase
4
- setup do
5
- User.send(:include, UserExtras)
6
- end
7
-
8
4
  should 'have tjb_id field' do
9
5
  assert User.fields.map(&:first).include?('tjb_id')
10
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesflip-jobboersen_integration
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors: []
13
13