def sign_in(who = :user)
      user = if who.instance_of?(User)
               who
             else
               FactoryGirl.build(:user).tap(&:save!)
             end
      visit new_user_session_path
      fill_in 'Email', with: user.email
      fill_in 'Password', with: user.password
      click_button 'Log in'
      expect(page).not_to have_text 'Invalid email or password.'
    end
def sign_in(who = :user)
      user = if who.instance_of?(User)
               who
             else
               FactoryGirl.build(:user).tap(&:save!)
             end
      visit new_user_session_path
      fill_in 'Email', with: user.email
      fill_in 'Password', with: user.password
      click_button 'Log in'
      expect(page).not_to have_text 'Invalid email or password.'
    end
Poltergeist-friendly sign-in
 Use this in feature tests