Skip to content

Commit

Permalink
Merge pull request #36 from oggy/master
Browse files Browse the repository at this point in the history
Add control verification request
  • Loading branch information
timcraft committed Apr 21, 2015
2 parents 4cd6efa + 3bbef3d commit fe8f92e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nexmo.rb
Expand Up @@ -118,6 +118,10 @@ def get_verification_request(id)
get('https://api.nexmo.com/verify/search/json', :request_id => id)
end

def control_verification_request(params)
post('https://api.nexmo.com/verify/control/json', params)
end

def request_number_insight(params)
post('/ni/json', params)
end
Expand Down
10 changes: 10 additions & 0 deletions spec/nexmo_spec.rb
Expand Up @@ -271,6 +271,16 @@ def json_response_body(content)
end
end

describe 'control_verification_request method' do
it 'posts to the control json resource and returns the response object' do
url = "#@api_base_url/verify/control/json"

stub_request(:post, url).with(@form_urlencoded_data).to_return(@json_response_body)

@client.control_verification_request(request_id: '8g88g88eg8g8gg9g90', cmd: 'cancel')
end
end

describe 'request_number_insight method' do
it 'posts to the number insight resource and returns the response object' do
url = "#@base_url/ni/json"
Expand Down

0 comments on commit fe8f92e

Please sign in to comment.