Error message
MicropostsInterfaceTest # test_micropost_interface:
ArgumentError: unknown keyword: micropost
    test/integration/microposts_interface_test.rb: 20: in `block (2 levels) in<class: MicropostsInterfaceTest>'
    test/integration/microposts_interface_test.rb: 19: in `block in<class: MicropostsInterfaceTest>'
Applicable source code
require 'test_helper'
class MicropostsInterfaceTest<ActionDispatch :: IntegrationTest
  def setup
    @user = users (: michael)
  test "micropost interface" do
    log_in_as (@user)
    get root_path
    assert_select 'div.pagination'
    assert_select 'input [type = "file"]'
    # Invalid transmission
    post microposts_path micropost: {content: ""}
    assert_select 'div # error_explanation'
    # Valid send
    content = "This micropost really ties the room together"
    picture = fixture_file_upload ('test/fixtures/rails.png', 'image/png')
    assert_difference 'Micropost.count', 1 do
      post microposts_path, micropost: {content: content, picture: picture}
    assert assigns (: micropost) .picture?
    assert_match content, response.body
    # Delete post
    assert_select 'a', text: 'delete'
    first_micropost = @ user.microposts.paginate (page: 1) .first
    assert_difference 'Micropost.count', -1 do
      delete micropost_path (first_micropost)
    # Access a different user's profile (make sure there is no delete link)
    get user_path (users (: archer))
    assert_select 'a', text: 'delete', count: 0
  test "micropost sidebar count" do
    log_in_as (@user)
    get root_path
    assert_match "#{@user.microposts.count} microposts", response.body
    # Users who have not yet posted microposts
    other_user = users (: malory)
    log_in_as (other_user)
    get root_path
    assert_match "0 microposts", response.body
    other_user.microposts.create! (content: "A micropost")
    get root_path
    assert_match "1 micropost", response.body

The post itself is successful on localhost
We have also confirmed that rails.png is at a predetermined position (test/fixtures/rails.png).

  • Answer # 1

    post microposts_path, params: {micropost: {content: content, picture: picture}}

    post microposts_path, micropost: {content: content, picture: picture}

    I was cured.
    Looks like params won't be pulled unless it is at the top.