How to test a complex controller action with an integration test

Hi, I am trying to write an integration test for a checkout process. From the documentation I found, I understood, that I had to interact in an integration test with the controllers through get and post requests.

I have difficulties in writing an integration test, which covers a complex checkout create action, which does not only create an order, but also create associated order_items.

I wrote a test along these lines

class ShopFlowsTest < ActionDispatch::IntegrationTest
  include Devise::Test::IntegrationHelpers

  test "placing order via wire transfer" do
    assert_difference('Order.count') do
      post orders_path, 
        params: {
          order: {
            # Contact Information
            # Shipping Address
            # Billing Address
            # Shippment details
    assert_response :redirect
    assert_redirected_to controller: :shops, action: :index

For this action:

def create
  session[:order_params].deep_merge!(params[:order]) if params[:order]
  @order =[:order_params])
  @order.populate_order(@cart) # <<<
  @order.current_step = session[:order_step]
  if @order.valid?
    if params[:back_button]
    elsif @order.last_step? if @order.all_valid?
    session[:order_step] = @order.current_step
  if @order.new_record?
    render "new"
    session[:order_step] = session[:order_params] = nil
    flash[:notice] = "Order saved!"
    redirect_to controller: :shops, action: :index

and get this error message:

FAIL ShopFlowsTest#test_placing_order_via_wire_transfer (1.58s)
        "Order.count" didn't change by 1.
        Expected: 3
          Actual: 2
        test/integration/shop_flows_test.rb:18:in `block in <class:ShopFlowsTest>'

I think the error message derives from the fact, that I am not giving the details of the products to the post request. In my app this info comes out of the database and through a method in my order model. How would one test this part in an integration test? I already did a system test, but would like to learn more about integration tests… Can it be done?

Thanks in advance!