def user(attributes, &block)
      default_attributes = {
        password: default_user_password,
        first_name: 'Elliot',
        last_name: 'Example'
      }

      User.find_or_create_by!(attributes.slice(:email)) do |user|
        user.attributes = default_attributes.merge(attributes)
        user.password_confirmation = user.password

        say_creating_user(user)
        yield(user) if block_given?
      end
    end
def user(attributes, &block)
      default_attributes = {
        password: default_user_password,
        first_name: 'Elliot',
        last_name: 'Example'
      }

      User.find_or_create_by!(attributes.slice(:email)) do |user|
        user.attributes = default_attributes.merge(attributes)
        user.password_confirmation = user.password

        say_creating_user(user)
        yield(user) if block_given?
      end
    end
Create a {User} if none with the given email exists yet.

 @param [Hash] attributes  attributes to override defaults
 @option attributes [String] :email  required
 @yield [user] a block to be called before the user is saved
 @return [User] newly created user