1
0
Fork 0

Display if account is superuser

This commit is contained in:
Alex Kotov 2019-08-12 01:11:59 +05:00
parent 94ccab8a18
commit ef89b1f381
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
5 changed files with 30 additions and 0 deletions

View file

@ -22,6 +22,12 @@
</div>
<% end %>
<% if @account.superuser? %>
<span class="badge badge-primary">
<%= translate :superuser %>
</span>
<% end %>
<hr/>
<% if @account.biography %>

View file

@ -5,3 +5,4 @@ en:
current: current
:yes: Yes
:no: No
superuser: Administrator

View file

@ -5,3 +5,4 @@ ru:
current: текущее
:yes: Да
:no: Нет
superuser: Администратор

View file

@ -7,6 +7,19 @@ Feature: Account
When I visit "/accounts/kotovalexarian"
Then I see text "kotovalexarian"
And I see text "Alex Kotov"
And I do not see text "Администратор"
And I see text "Hi there :)"
# And I see text "Не относится к партии"
Scenario: of a superuser
Given there is a superuser account with the following data:
| nickname | kotovalexarian |
| public_name | Alex Kotov |
| biography | Hi there :) |
When I visit "/accounts/kotovalexarian"
Then I see text "kotovalexarian"
And I see text "Alex Kotov"
And I see text "Администратор"
And I see text "Hi there :)"
# And I see text "Не относится к партии"

View file

@ -9,6 +9,15 @@ When 'there is a usual account with the following data:' do |table|
biography: options[:biography]
end
When 'there is a superuser account with the following data:' do |table|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h
create :superuser_account,
nickname: options[:nickname],
public_name: options[:public_name],
biography: options[:biography]
end
When 'there is a supporter account with the following data:' do |table|
options = table.raw.map { |(k, v)| [k.to_sym, v] }.to_h