1
0
Fork 0

Add features

This commit is contained in:
Alex Kotov 2019-08-15 08:58:02 +05:00
parent 08546ee085
commit ee288fb0cf
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
3 changed files with 37 additions and 0 deletions

View File

@ -39,4 +39,12 @@ FactoryBot.define do
regional_office: evaluator.regional_office
end
end
factory :federal_manager_person, parent: :initial_person do
after :create do |person, evaluator|
create :federal_manager_relationship,
person: person,
regional_office: evaluator.regional_office
end
end
end

View File

@ -61,3 +61,17 @@ Feature: Account
And I see text "Hi there :)"
And I see text "Исключён из партии"
And I see text "Москва"
Scenario: of a federal manager
Given there is a federal manager account with the following data:
| nickname | kotovalexarian |
| public_name | Alex Kotov |
| biography | Hi there :) |
| federal_subject | Москва |
When I visit "/accounts/kotovalexarian"
Then I see text "kotovalexarian"
And I see text "Alex Kotov"
And I see text "Hi there :)"
And I see text "Член партии"
And I see text "Член ФК"
And I see text "Москва"

View File

@ -62,3 +62,18 @@ When 'there is an excluded member account with the following data:' do |table|
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