title: Why does assert_not flash.empty? not work in integration rails test?
body: <p>HEre is my code for my integration test:</p>
  
  <p>require 'test_helper'</p>
  
  <pre><code>class UserSignupTest &lt; ActionDispatch::IntegrationTest
  
    test "a user can signup and return back to root url" do
      visit new_user_path
  
      fill_in "user[username]", with: "flyers1"
      fill_in "user[first_name]", with: "user"
      fill_in "user[last_name]", with: "name"
      fill_in "user[email]", with: "username@gmail.com"
      fill_in "user[street]", with: "street"
      fill_in "user[city]", with: "city"
      fill_in "user[state]", with: "state"
      fill_in "user[country]", with: "country"
      fill_in "user[password]", with: "password"
      fill_in "user[password_confirmation]", with: "password"
      click_button "Finish Signup"
  
      refute flash.empty?
  end
  </code></pre>
  
  <p>Here is my controller method for create:</p>
  
  <pre><code>def create
      user = User.new(user_params)
      if user.valid?
        valid_user_signup(user)
      else
        invalid_user_signup(user)
      end
    end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>def valid_user_signup(user)
      user.save
      session[:user_id] = user.id
      flash[:success] = "Signup Successful"
      redirect_to root_path
    end
  </code></pre>
  
  <p>What is going on here? Why do I get an error message that says "undefined method flash" for nil:nilclass?</p>