Sha256: 8fb55510352bf943e0d8c2300830a53798da58ec4f4f1fbfddc580c1ef2f20b5

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

def current_email_address
  "cucumber@sumapp.com"
end

def fill_all_with_valid_data(hash={})
  valid = {
    'savings' => '0',
    'income' => '0',
    'bills' => '0',
    'email' => current_email_address,
    'tos' => '1'
  }.merge(hash)
  valid.each do |key, value|
    case key
    when 'tos'
      check "user[#{key}]"
    else
      fill_in "user[#{key}]", :with => value
    end
  end
end

def find_user
  UserEmail.find_by_email(current_email_address).user
end

def generate_email(options={})
<<EMAIL
Delivered-To: test@sumapp.com
Return-Path: <#{options[:from] || current_email_address}>
From: Winton Welsh <#{options[:from] || current_email_address}>
To: test@sumapp.com
Subject: #{options[:subject] || ''}
Content-Type: multipart/alternative; boundary=000325574d2a5057e1046eae4ba5

--000325574d2a5057e1046eae4ba5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

#{options[:body] || ''}

--000325574d2a5057e1046eae4ba5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

#{options[:body] || ''}<br>

--000325574d2a5057e1046eae4ba5--
EMAIL
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
winton-sum-0.1.1 features/support/helpers.rb
sum-0.1.2 features/support/helpers.rb
sum-0.1.1 features/support/helpers.rb