1
0
Fork 0

Add congratulations

This commit is contained in:
Alex Kotov 2018-12-15 10:24:23 +05:00
parent 7dd2721007
commit 9ab7c5213e
No known key found for this signature in database
GPG key ID: 4E831250F47DE154
5 changed files with 53 additions and 4 deletions

View file

@ -1,5 +1,10 @@
<div class="container">
<% if @membership_app.person %>
<h1><%= translate '.congratulations' %></h1>
<p class="lead"><%= translate '.lead_congratulations' %></p>
<% else %>
<h1><%= translate '.header' %></h1>
<p class="lead"><%= translate '.lead_text' %></p>
<hr/>
<% end %>
</div>

View file

@ -9,6 +9,9 @@ ru:
личности.
membership_apps:
show:
congratulations: Поздравляем!
lead_congratulations: >
Вы уже являетесь членом или сторонником Либертарианской партии России!
header: Ваше заявление в обработке
lead_text: >
На данной странице вы можете отслеживать статус вашего заявления.

View file

@ -1,5 +1,5 @@
Feature: Membership application
Scenario:
Scenario: as a visitor
When I visit the main page
And I click the button "Вступить"
And I fill form with the following data:
@ -15,3 +15,9 @@ Feature: Membership application
| Комментарий | Примите, плиз |
And I click the form button "Отправить заявление"
Then I see the membership application tracking page
Scenario: as a member
Given I am signed in as party member
When I visit the main page
And I click the button "Ваше заявление"
Then I see that I am already a party member

View file

@ -11,6 +11,23 @@ end
Then 'I see the membership application tracking page' do
expect(page.current_path).to eq '/application'
expect(page).to have_css 'h1', text: 'Ваше заявление в обработке'
expect(page).to have_css(
'p.lead',
text: <<~TEXT.split("\n").join(' '),
На данной странице вы можете отслеживать статус вашего заявления.
Сохраните её в закладки браузера. Также на указанный вами адрес
электронной почты была отправлена ссылка на данную страницу.
В ближайшее время с вами свяжутся по указанным вами контактам.
TEXT
)
end
Then 'I see that I am already a party member' do
expect(page.current_path).to eq '/application'
expect(page).to have_css 'h1', text: 'Поздравляем!'
expect(page).to have_css 'p.lead',
text: 'Вы уже являетесь членом или сторонником ' \
'Либертарианской партии России!'
end
When 'I send a membership application' do

View file

@ -40,6 +40,24 @@ Given 'I am signed in with email {string} ' \
expect(page).to have_css 'ul > li > a', text: @user.email
end
Given 'I am signed in as party member' do
@person = create :person
@account = create :usual_account, person: @person
create :membership_app, account: @account
@user = @account.user
visit '/users/sign_in'
within 'form' do
fill_in 'Email', with: @user.email
fill_in 'Пароль', with: @user.password
click_on 'Войти'
end
expect(page).to have_css 'ul > li > a', text: @user.email
end
When 'I try to sign in with email {string} ' \
'and password {string}' do |email, password|
visit '/users/sign_in'