Get WebMock matchers to work
This commit is contained in:
parent
209d848079
commit
bad73c5d8b
2 changed files with 7 additions and 4 deletions
6
app/helpers/external/mailbluster_helper.rb
vendored
6
app/helpers/external/mailbluster_helper.rb
vendored
|
|
@ -9,11 +9,13 @@ module External
|
|||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
request = Net::HTTP::Post.new(uri.path,
|
||||
{'Authorization' => ENV["MAILBLUSTER_API_KEY"]}) # TODO Authorization=APIKEY
|
||||
request.body = {'firstName' => user.name,
|
||||
request.body = {
|
||||
'email' => user.email,
|
||||
'firstName' => user.name,
|
||||
'overrideExisting' => true,
|
||||
'subscribed' => true,
|
||||
'tags' => ["snapcon"],
|
||||
'overrideExisting' => true}.to_json
|
||||
}.to_json
|
||||
puts request.body.to_json
|
||||
response = http.request(request)
|
||||
puts response.body.to_json
|
||||
|
|
|
|||
|
|
@ -37,11 +37,12 @@ describe External::MailblusterHelper, type: :helper do
|
|||
}', status: 200)
|
||||
create_lead(user)
|
||||
expect(WebMock).to have_requested(:post, "api.mailbluster.com/api/leads").with(body: {
|
||||
'firstName': user.name,
|
||||
'email': user.email,
|
||||
'firstName': user.name,
|
||||
'overrideExisting': true,
|
||||
'subscribed': true,
|
||||
'tags': ["snapcon"],
|
||||
'overrideExisting': true})
|
||||
}.to_json)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue