roqua-core-api 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a4c4f6f88862ed1b7cd926af421153f10bf8199
|
4
|
+
data.tar.gz: d0f78eb13ea7b153bf388b1512225a62c571530b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 754c820ef19069a062e6470e78175e93b157d6766f380b33c87c80f99cbab02b48cb1c384c8a0b2dd66b55af24e2f899229b4dccf5ce406ea4b2653452042f6d
|
7
|
+
data.tar.gz: 916e9fe188cbd2abd3d966592c85c6ceb6984a6e04241028ea1da455701dec9529cf520572abc8d2e08d93485d5515153fb9898b9e97e1285e237814e460d15a
|
data/ChangeLog.md
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Roqua
|
2
|
+
module CoreApi
|
3
|
+
# @api private
|
4
|
+
class SendTextMessageTo < ActiveInteraction::Base
|
5
|
+
string :person_id
|
6
|
+
hash :attributes do
|
7
|
+
string :body
|
8
|
+
string :reference, default: nil
|
9
|
+
end
|
10
|
+
string :username, default: ENV['CORE_BASICAUTH_ID']
|
11
|
+
string :password, default: ENV['CORE_BASICAUTH_SECRET']
|
12
|
+
|
13
|
+
# Possible variables in the body are:
|
14
|
+
# %firstname%,
|
15
|
+
# %lastname%,
|
16
|
+
# %initials%
|
17
|
+
def execute
|
18
|
+
CoreApi.basic_auth_session(username: username, password: password)
|
19
|
+
.post "/text_messages", text_message: attributes, person_id: person_id
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/roqua/core_api.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SendTextMessageTo do
|
4
|
+
let(:session) { Sessions::BasicAuthSession.new }
|
5
|
+
before { allow(Sessions::BasicAuthSession).to receive(:new).and_return session }
|
6
|
+
|
7
|
+
it 'performs a post on the text_messages api path providing the person_id and the text_message attributes' do
|
8
|
+
text_message_attributes = { body: 'some_body',
|
9
|
+
reference: 'some_reference'}
|
10
|
+
expect(session).to receive(:post).with '/text_messages', person_id: 'some_person_id',
|
11
|
+
text_message: text_message_attributes
|
12
|
+
SendTextMessageTo.run!(person_id: 'some_person_id', attributes: text_message_attributes)
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-core-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -207,6 +207,7 @@ files:
|
|
207
207
|
- lib/roqua/core_api/person.rb
|
208
208
|
- lib/roqua/core_api/send_email_to.rb
|
209
209
|
- lib/roqua/core_api/send_invite_email.rb
|
210
|
+
- lib/roqua/core_api/send_text_message_to.rb
|
210
211
|
- lib/roqua/core_api/sessions.rb
|
211
212
|
- lib/roqua/core_api/sessions/auth_session.rb
|
212
213
|
- lib/roqua/core_api/sessions/basic_auth_session.rb
|
@@ -234,6 +235,7 @@ files:
|
|
234
235
|
- spec/lib/roqua/core_api/models/person_spec.rb
|
235
236
|
- spec/lib/roqua/core_api/send_email_to_spec.rb
|
236
237
|
- spec/lib/roqua/core_api/send_invite_email_spec.rb
|
238
|
+
- spec/lib/roqua/core_api/send_text_message_to_spec.rb
|
237
239
|
- spec/lib/roqua/core_api/sessions/auth_session_spec.rb
|
238
240
|
- spec/lib/roqua/core_api/sessions/basic_auth_session_spec.rb
|
239
241
|
- spec/lib/roqua/core_api/sessions/oauth_session_spec.rb
|
@@ -280,6 +282,7 @@ test_files:
|
|
280
282
|
- spec/lib/roqua/core_api/models/person_spec.rb
|
281
283
|
- spec/lib/roqua/core_api/send_email_to_spec.rb
|
282
284
|
- spec/lib/roqua/core_api/send_invite_email_spec.rb
|
285
|
+
- spec/lib/roqua/core_api/send_text_message_to_spec.rb
|
283
286
|
- spec/lib/roqua/core_api/sessions/auth_session_spec.rb
|
284
287
|
- spec/lib/roqua/core_api/sessions/basic_auth_session_spec.rb
|
285
288
|
- spec/lib/roqua/core_api/sessions/oauth_session_spec.rb
|
@@ -287,3 +290,4 @@ test_files:
|
|
287
290
|
- spec/lib/roqua/core_api/update_dossier_spec.rb
|
288
291
|
- spec/spec_helper.rb
|
289
292
|
- spec/support/httpparty_helpers.rb
|
293
|
+
has_rdoc:
|