title: Assert value of an error message with Minitest
body: <p>The following method requires testing</p>
  <pre><code>if params[:id_at_chain].blank?  
    @error_code_99 = true
    @error_99_messages = @error_99_messages + &quot; id_at_chain missing. &quot;
  end
  </code></pre>
  <p>this is a sub-method to another method to determine the record creation if that param is not blank</p>
  <p>The following test succeeds in asserting that the record is not created</p>
  <pre><code>  test &quot;no id at chain&quot; do
      assert_no_difference('Article.count') do
        post array_api_v1_articles_path, params: {
        &quot;articles&quot;: [
          {
            &quot;code&quot;: &quot;000000000000000084&quot;,
            }
          ]
        }, as: :json
        puts @error_code_99
        puts @error_99_messages
        assert_equal(&quot; id_at_chain missing. &quot;, @error_99_messages)
      end
    end
  </code></pre>
  <p>But the two method instances variables (these are not written to the database) are resulting in nul values and thus the <code>assert_equal</code> assertion is not possible.</p>
  <p>How can this be achieved?</p>