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
2019-08-15 08:58:02 +05:00

79 lines
2.8 KiB
Ruby

# frozen_string_literal: true
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,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography]
end
When 'there is a superuser account with the following data:' do |table|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
create :superuser_account,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography]
end
When 'there is a supporter account with the following data:' do |table|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
federal_subject =
create :federal_subject, english_name: options[:federal_subject]
regional_office = create :regional_office, federal_subject: federal_subject
person = create :supporter_person, regional_office: regional_office
create :personal_account,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography],
person: person
end
When 'there is a member account with the following data:' do |table|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
federal_subject =
create :federal_subject, english_name: options[:federal_subject]
regional_office = create :regional_office, federal_subject: federal_subject
person = create :member_person, regional_office: regional_office
create :personal_account,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography],
person: person
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
federal_subject =
create :federal_subject, english_name: options[:federal_subject]
regional_office = create :regional_office, federal_subject: federal_subject
person = create :excluded_person, regional_office: regional_office
create :personal_account,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography],
person: person
end
When 'there is a federal manager account with the following data:' do |table|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
federal_subject =
create :federal_subject, english_name: options[:federal_subject]
regional_office = create :regional_office, federal_subject: federal_subject
person = create :federal_manager_person, regional_office: regional_office
create :personal_account,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography],
person: person
end