I have inherited some intermittently failing tests that create something in the interface, met some issues.

Hello Ruby friends.

I have inherited some intermittently failing tests that create something in the interface, then make some assertions by grabbing the last of these things by created_by from the database. For one reason or another, this sometimes matches up and sometimes doesn’t.

Any thoughts about refactoring these? My instinct is that if it’s creating it in the interface, it should only be asserting things present in the interface rather than reaching into the database... is this a concept with a name?
You already invited:

Amos

Upvotes from:

maybe blackbox testing

dennis

Upvotes from:

I’d hesitantly tend to call this integration testing, however the way it’s used in specifically rails land tends to differ from the wider research body on the topics

In the sense that the default rails testing folders give you a folder called integration, and the way it’s used doesn’t seem to be the same way other languages use the terminology.
However, it does seem to be pretty common to have a test like this that seems to want to ensure the POST web interface, actually persists items in the database

If you wanna answer this question please Login or Register