1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/features/step_definitions/account.rb

53 lines
1.9 KiB
Ruby
Raw Normal View History

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
country_state = create :country_state, 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
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
country_state = create :country_state, name: options[:country_state]
2019-03-24 14:23:52 -04:00
regional_office = create :regional_office, country_state: country_state
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],
biography: options[:biography],
person: person
2019-03-24 09:59:47 -04:00
end
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
country_state = create :country_state, name: options[:country_state]
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],
public_name: options[:public_name],
biography: options[:biography],
person: person
end