test/controllers/courses_controller_test.rb
def with_users_signed_in(users)
    raise 'argument array should not be empty' if users.empty?

    users.each do |user|
      who = if user
              "#{user.permission}:#{user.membership_status_for(@course)}"
            else
              'not signed in'
            end
      sign_in user if user
      yield who, user
      sign_out :user
    end
  end
# execute the block with each user signed in
# if a user is nil, nobody is signed in
execute the block with each user signed in
if a user is nil, nobody is signed in
execute the block with each user signed in if a user is nil nobody is signed in
def with_users_signed_in(users)
    raise 'argument array should not be empty' if users.empty?
    users.each do |user|
      who = if user
              "#{user.permission}:#{user.membership_status_for(@course)}"
            else
              'not signed in'
            end
      sign_in user if user
      yield who, user
      sign_out :user
    end
  end
def with_users_signed_in ( users ) raise 'argument array should not be empty' if users . empty? users . each do | user | who = if user "#{user.permission}:#{user.membership_status_for(@course)}" else 'not signed in' end sign_in user if user yield who , user sign_out :user end end
execute the block with each user signed in
if a user is nil, nobody is signed in
execute the block with each user signed in if a user is nil nobody is signed in
users