The big three:
Integration Tests: Testing that everything works together.
Functional Tests: Testing a single controller
Unit Tests: Testing a model
I’ve never knowingly used a regression or a smoke test, I have no idea what they’re for! A feature is generally going to be something that’s tested in an integration test.
For example: here’s a feature being tested in an integration test using Rspec and Capybara:
feature 'Sign in as a user' do
let(:user) { Fabricate :user }
scenario 'with an email address and password' do
visit sign_in_path
fill_in 'email', with: user.email
fill_in 'password', with: 'password'
click_button 'sign in'
expect(page).to have_content "Welcome #{user.first_name}
end
end
You can see that the above example isn’t testing just that a User is valid (that would be a unit test) and it’s not testing a specific controller (that would be a functional test,) it’s actually testing an entire range of “stuff” that’s happening: that there’s a sign_in route, that the user is a valid user and that the user gets some kind of “result” from the actions, in this case, they see a welcome message. It’s testing that the user is signed in and that tests whether or not a session was created for the User.
A Unit test in the same context would test things like: does this user have a unique email, is the user password long enough, is the email in a valid format. Everything dealing with specifically a User object would be tested with a Unit test.
An acceptance test is really just a test to determine if a particular piece of functionality is acceptable to the client (or boss/project manager, etc.) For me, the integration tests are generally also the acceptance tests. Meaning: if the integration tests pass, that feature “works” and is therefore accepted.
As far as resources – the best one, given your question would be the TDD with Rails online workshop that Thoughtbot has. You’re already a Prime subscriber, so you’re good to go. It walks you through the types of test in a very practical way – trust me, you go through this course, you’ll understand the different types of testing easily. The Michael Hartl Rails Tutorial stuff is also useful, but I think the Thoughtbot TDD online course will make the answers to your question even more clear.
I am not the definitive expert on this (or anything for that matter,) so someone correct me or elaborate if I’m wrong!