In minitest, prior to Hotwire, a create test might look like the following:
test "should create user" do
assert_difference('User.count') do
post users_url, params: { user: valid_params }
end
assert_redirected_to users_path
end
After changing the create controller action to respond_to :turbo_stream, the above test will no longer execute correctly. I've tried simply passing format: :turbo_stream as part of the params hash...but, this didn't work either.
post users_url, params: { user: valid_params, format: 'turbo_stream' }
There must be a Rails 7 way of testing this. It's possible Minitest hasn't been updated yet for these new features.
Has anyone updated their tests for this new format?