A
A
Alexey Yarkov2017-02-19 12:32:16
API
Alexey Yarkov, 2017-02-19 12:32:16

How do you test the API?

I have such API methods as registration with Email confirmation, authorization and account deletion
I sent a POST to /api/v1/signup
I received a response:

HTTP/1.1 200 OK
{"message": "Registration success!"}

And all? Plug? How can I automate further tests? Or every time, before running the tests, turn off the confirmation?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaliy Orlov, 2017-02-19
@yarkov

It all depends on your tasks and goals. You can turn it off, you can redirect letters somewhere and parse them for further tests, or you can go to real mail, check whether a letter has arrived or not ... In general, as much as you want to get confused, do it .. I would make a stub for sending mail, would redirect letters to files and check them.

_
_ _, 2017-02-19
@AMar4enko

In my opinion, API integration testing from the outside is the last thing to do. Test the API separately with a unit test by dampening the mail sending service so that it adds the sent letters to the array and the mail service itself separately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question