Compare commits
4 Commits
602ca6ee94
...
v0.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 8903ae2624 | |||
|
26e9073674
|
|||
| 73a89c2601 | |||
|
7d4dee17b7
|
@@ -1 +1 @@
|
||||
EJABBERD_API_URL='https://xmpp.kosmos.org/api'
|
||||
EJABBERD_API_URL='https://xmpp.kosmos.org:5443/api'
|
||||
|
||||
@@ -4,7 +4,7 @@ class EjabberdApiClient
|
||||
end
|
||||
|
||||
def post(endpoint, payload)
|
||||
res = Faraday.post("#{@base_url}/#{endpoint}", payload,
|
||||
res = Faraday.post("#{@base_url}/#{endpoint}", payload.to_json,
|
||||
"Content-Type" => "application/json")
|
||||
|
||||
if res.status != 200
|
||||
|
||||
@@ -90,17 +90,9 @@ RSpec.describe CreateAccount, type: :model do
|
||||
service.send(:exchange_xmpp_contacts)
|
||||
|
||||
expect(WebMock).to have_requested(:post, "http://xmpp.example.com/api/add_rosteritem")
|
||||
.with { |req| req.body == {
|
||||
localuser: "isaacnewton", localhost: "kosmos.org",
|
||||
user: "willherschel", host: "kosmos.org",
|
||||
nick: "willherschel", group: "Friends", subs: "both"
|
||||
}}
|
||||
.with { |req| req.body == '{"localuser":"isaacnewton","localhost":"kosmos.org","user":"willherschel","host":"kosmos.org","nick":"willherschel","group":"Friends","subs":"both"}' }
|
||||
expect(WebMock).to have_requested(:post, "http://xmpp.example.com/api/add_rosteritem")
|
||||
.with { |req| req.body == {
|
||||
localuser: "willherschel", localhost: "kosmos.org",
|
||||
user: "isaacnewton", host: "kosmos.org",
|
||||
nick: "isaacnewton", group: "Friends", subs: "both"
|
||||
}}
|
||||
.with { |req| req.body == '{"localuser":"willherschel","localhost":"kosmos.org","user":"isaacnewton","host":"kosmos.org","nick":"isaacnewton","group":"Friends","subs":"both"}' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user