With the release of Rails 5.1, they included system tests. Which means we can test our JavaScript too in Rails. I see Rails guide explains a sample test creating article in both ways: via system test and via integration test.
Now the question is: before Rails 5.1 I was writing complex test cases in integration tests. But now I have two options to write a test case. I can write test case like
test: should create article
in integration test, but I can also write the same test case in system test.
So when should I choose system test to write a test case and when to choose integration tests ?