Add congratulations
This commit is contained in:
parent
7dd2721007
commit
9ab7c5213e
5 changed files with 53 additions and 4 deletions
|
@ -1,5 +1,10 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<% if @membership_app.person %>
|
||||||
|
<h1><%= translate '.congratulations' %></h1>
|
||||||
|
<p class="lead"><%= translate '.lead_congratulations' %></p>
|
||||||
|
<% else %>
|
||||||
<h1><%= translate '.header' %></h1>
|
<h1><%= translate '.header' %></h1>
|
||||||
<p class="lead"><%= translate '.lead_text' %></p>
|
<p class="lead"><%= translate '.lead_text' %></p>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,6 +9,9 @@ ru:
|
||||||
личности.
|
личности.
|
||||||
membership_apps:
|
membership_apps:
|
||||||
show:
|
show:
|
||||||
|
congratulations: Поздравляем!
|
||||||
|
lead_congratulations: >
|
||||||
|
Вы уже являетесь членом или сторонником Либертарианской партии России!
|
||||||
header: Ваше заявление в обработке
|
header: Ваше заявление в обработке
|
||||||
lead_text: >
|
lead_text: >
|
||||||
На данной странице вы можете отслеживать статус вашего заявления.
|
На данной странице вы можете отслеживать статус вашего заявления.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Feature: Membership application
|
Feature: Membership application
|
||||||
Scenario:
|
Scenario: as a visitor
|
||||||
When I visit the main page
|
When I visit the main page
|
||||||
And I click the button "Вступить"
|
And I click the button "Вступить"
|
||||||
And I fill form with the following data:
|
And I fill form with the following data:
|
||||||
|
@ -15,3 +15,9 @@ Feature: Membership application
|
||||||
| Комментарий | Примите, плиз |
|
| Комментарий | Примите, плиз |
|
||||||
And I click the form button "Отправить заявление"
|
And I click the form button "Отправить заявление"
|
||||||
Then I see the membership application tracking page
|
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
|
||||||
|
|
|
@ -11,6 +11,23 @@ end
|
||||||
Then 'I see the membership application tracking page' do
|
Then 'I see the membership application tracking page' do
|
||||||
expect(page.current_path).to eq '/application'
|
expect(page.current_path).to eq '/application'
|
||||||
expect(page).to have_css 'h1', text: 'Ваше заявление в обработке'
|
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
|
end
|
||||||
|
|
||||||
When 'I send a membership application' do
|
When 'I send a membership application' do
|
||||||
|
|
|
@ -40,6 +40,24 @@ Given 'I am signed in with email {string} ' \
|
||||||
expect(page).to have_css 'ul > li > a', text: @user.email
|
expect(page).to have_css 'ul > li > a', text: @user.email
|
||||||
end
|
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} ' \
|
When 'I try to sign in with email {string} ' \
|
||||||
'and password {string}' do |email, password|
|
'and password {string}' do |email, password|
|
||||||
visit '/users/sign_in'
|
visit '/users/sign_in'
|
||||||
|
|
Reference in a new issue