From 42663fc7642d8bca69d68b859258a7b949168080 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 24 Mar 2019 23:47:55 +0500 Subject: [PATCH] Add scenario "Account of an excluded member" --- features/desktop/account.feature | 11 +++++++++++ features/step_definitions/account.rb | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/features/desktop/account.feature b/features/desktop/account.feature index 2c78ab1..44a246b 100644 --- a/features/desktop/account.feature +++ b/features/desktop/account.feature @@ -30,3 +30,14 @@ Feature: Account Then I see text "kotovalexarian" And I see text "Alex Kotov" And I see text "Hi there :)" + + Scenario: of an excluded member + Given there is an excluded member account with the following data: + | username | kotovalexarian | + | public_name | Alex Kotov | + | biography | Hi there :) | + | country_state | Москва | + When I visit "/accounts/kotovalexarian" + Then I see text "kotovalexarian" + And I see text "Alex Kotov" + And I see text "Hi there :)" diff --git a/features/step_definitions/account.rb b/features/step_definitions/account.rb index ede0ec1..90edea6 100644 --- a/features/step_definitions/account.rb +++ b/features/step_definitions/account.rb @@ -36,3 +36,17 @@ When 'there is a member account with the following data:' do |table| 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 + + 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, + username: options[:username], + public_name: options[:public_name], + biography: options[:biography], + person: person +end