Fix XMPP API POST request
Faraday does not turn hashes into JSON by itself apparently.
This commit is contained in:
@@ -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