passaporteweb-client 0.0.14 → 0.0.15

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
- passaporteweb-client (0.0.14)
4
+ passaporteweb-client (0.0.15)
5
5
  multi_json (~> 1.7.1)
6
6
  rest-client (~> 1.6.7)
7
7
 
@@ -8,7 +8,7 @@ module PassaporteWeb
8
8
 
9
9
  ATTRIBUTES = [:accounts, :birth_date, :country, :cpf, :email, :first_name, :gender, :is_active, :language, :last_name, :nickname, :notifications, :send_myfreecomm_news, :send_partner_news, :services, :timezone, :update_info_url, :uuid, :password, :password2, :must_change_password, :inhibit_activation_message, :tos]
10
10
  UPDATABLE_ATTRIBUTES = [:first_name, :last_name, :nickname, :cpf, :birth_date, :gender, :send_myfreecomm_news, :send_partner_news, :country, :language, :timezone]
11
- CREATABLE_ATTRIBUTES = *(UPDATABLE_ATTRIBUTES + [:email, :password, :password2, :must_change_password, :tos])
11
+ CREATABLE_ATTRIBUTES = *(UPDATABLE_ATTRIBUTES + [:email, :password, :password2, :must_change_password, :tos, :inhibit_activation_message])
12
12
 
13
13
  attr_accessor *UPDATABLE_ATTRIBUTES
14
14
  attr_reader *(ATTRIBUTES - UPDATABLE_ATTRIBUTES)
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module PassaporteWeb
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
@@ -6,7 +6,7 @@ describe PassaporteWeb::Identity do
6
6
  describe "constants" do
7
7
  it { described_class::ATTRIBUTES.should == [:accounts, :birth_date, :country, :cpf, :email, :first_name, :gender, :is_active, :language, :last_name, :nickname, :notifications, :send_myfreecomm_news, :send_partner_news, :services, :timezone, :update_info_url, :uuid, :password, :password2, :must_change_password, :inhibit_activation_message, :tos] }
8
8
  it { described_class::UPDATABLE_ATTRIBUTES.should == [:first_name, :last_name, :nickname, :cpf, :birth_date, :gender, :send_myfreecomm_news, :send_partner_news, :country, :language, :timezone] }
9
- it { described_class::CREATABLE_ATTRIBUTES.should == [:first_name, :last_name, :nickname, :cpf, :birth_date, :gender, :send_myfreecomm_news, :send_partner_news, :country, :language, :timezone, :email, :password, :password2, :must_change_password, :tos] }
9
+ it { described_class::CREATABLE_ATTRIBUTES.should == [:first_name, :last_name, :nickname, :cpf, :birth_date, :gender, :send_myfreecomm_news, :send_partner_news, :country, :language, :timezone, :email, :password, :password2, :must_change_password, :tos, :inhibit_activation_message] }
10
10
  end
11
11
 
12
12
  describe ".new" do
@@ -268,6 +268,22 @@ describe PassaporteWeb::Identity do
268
268
  identity.save.should be_true
269
269
  identity.should be_persisted
270
270
  end
271
+ # REGRESSION
272
+ it "should send the inhibit_activation_message information" do
273
+ attributes = {
274
+ email: 'obiwan88@suremail.info',
275
+ password: 'theforce',
276
+ password2: 'theforce',
277
+ tos: true,
278
+ inhibit_activation_message: true,
279
+ send_partner_news: false,
280
+ send_myfreecomm_news: true
281
+ }
282
+ identity = described_class.new(attributes)
283
+ mock_response = mock('response', code: 200, body: MultiJson.encode(attributes))
284
+ PassaporteWeb::Http.should_receive(:post).with("/accounts/api/create/", attributes).and_return(mock_response)
285
+ identity.save.should be_true
286
+ end
271
287
  end
272
288
  context "on failure" do
273
289
  it "should not save" do
@@ -38,7 +38,7 @@ describe PassaporteWeb::ServiceAccount do
38
38
  end
39
39
 
40
40
  describe ".find_all", :vcr => true do
41
- let(:mock_response) { mock('response', body: [].to_json, code: 200, headers: {link: "<http://sandbox.app.passaporteweb.com.br/organizations/api/accounts/?page=3&limit=3>; rel=next, <http://sandbox.app.passaporteweb.com.br/organizations/api/accounts/?page=1&limit=3>; rel=prev"}) }
41
+ let(:mock_response) { mock('response', body: MultiJson.encode([]), code: 200, headers: {link: "<http://sandbox.app.passaporteweb.com.br/organizations/api/accounts/?page=3&limit=3>; rel=next, <http://sandbox.app.passaporteweb.com.br/organizations/api/accounts/?page=1&limit=3>; rel=prev"}) }
42
42
  it "should find all accounts related to the authenticated application and return them as an array of Account instances" do
43
43
  accounts_and_meta = PassaporteWeb::ServiceAccount.find_all
44
44
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: passaporteweb-client
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.14
5
+ version: 0.0.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rodrigo Tassinari de Oliveira
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-18 00:00:00.000000000 Z
13
+ date: 2013-05-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client