Add features
This commit is contained in:
parent
08546ee085
commit
ee288fb0cf
|
@ -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
|
||||
|
|
|
@ -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 "Москва"
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue