2019-03-24 09:59:47 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-24 14:01:59 -04:00
|
|
|
When 'there is a usual account with the following data:' do |table|
|
|
|
|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
|
|
|
|
|
|
|
|
create :usual_account,
|
2019-03-24 15:27:06 -04:00
|
|
|
nickname: options[:nickname],
|
2019-03-24 14:01:59 -04:00
|
|
|
public_name: options[:public_name],
|
|
|
|
biography: options[:biography]
|
|
|
|
end
|
|
|
|
|
2019-03-24 14:12:17 -04:00
|
|
|
When 'there is a supporter account with the following data:' do |table|
|
|
|
|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
|
|
|
|
|
2019-03-24 17:13:56 -04:00
|
|
|
country_state = create :country_state, english_name: options[:country_state]
|
2019-03-24 14:23:52 -04:00
|
|
|
regional_office = create :regional_office, country_state: country_state
|
2019-03-24 14:12:17 -04:00
|
|
|
person = create :supporter_person, regional_office: regional_office
|
|
|
|
|
|
|
|
create :personal_account,
|
2019-03-24 15:27:06 -04:00
|
|
|
nickname: options[:nickname],
|
2019-03-24 14:12:17 -04:00
|
|
|
public_name: options[:public_name],
|
|
|
|
biography: options[:biography],
|
|
|
|
person: person
|
|
|
|
end
|
|
|
|
|
2019-03-24 13:59:37 -04:00
|
|
|
When 'there is a member account with the following data:' do |table|
|
2019-03-24 09:59:47 -04:00
|
|
|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
|
|
|
|
|
2019-03-24 17:13:56 -04:00
|
|
|
country_state = create :country_state, english_name: options[:country_state]
|
2019-03-24 14:23:52 -04:00
|
|
|
regional_office = create :regional_office, country_state: country_state
|
2019-03-24 13:59:37 -04:00
|
|
|
person = create :member_person, regional_office: regional_office
|
|
|
|
|
2019-03-24 09:59:47 -04:00
|
|
|
create :personal_account,
|
2019-03-24 15:27:06 -04:00
|
|
|
nickname: options[:nickname],
|
2019-03-24 09:59:47 -04:00
|
|
|
public_name: options[:public_name],
|
2019-03-24 13:59:37 -04:00
|
|
|
biography: options[:biography],
|
|
|
|
person: person
|
2019-03-24 09:59:47 -04:00
|
|
|
end
|
2019-03-24 14:47:55 -04:00
|
|
|
|
|
|
|
When 'there is an excluded member account with the following data:' do |table|
|
|
|
|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
|
|
|
|
|
2019-03-24 17:13:56 -04:00
|
|
|
country_state = create :country_state, english_name: options[:country_state]
|
2019-03-24 14:47:55 -04:00
|
|
|
regional_office = create :regional_office, country_state: country_state
|
|
|
|
person = create :excluded_person, regional_office: regional_office
|
|
|
|
|
|
|
|
create :personal_account,
|
2019-03-24 15:27:06 -04:00
|
|
|
nickname: options[:nickname],
|
2019-03-24 14:47:55 -04:00
|
|
|
public_name: options[:public_name],
|
|
|
|
biography: options[:biography],
|
|
|
|
person: person
|
|
|
|
end
|