Display if account is superuser
This commit is contained in:
parent
94ccab8a18
commit
ef89b1f381
5 changed files with 30 additions and 0 deletions
|
@ -22,6 +22,12 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @account.superuser? %>
|
||||
<span class="badge badge-primary">
|
||||
<%= translate :superuser %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<hr/>
|
||||
|
||||
<% if @account.biography %>
|
||||
|
|
|
@ -5,3 +5,4 @@ en:
|
|||
current: current
|
||||
:yes: Yes
|
||||
:no: No
|
||||
superuser: Administrator
|
||||
|
|
|
@ -5,3 +5,4 @@ ru:
|
|||
current: текущее
|
||||
:yes: Да
|
||||
:no: Нет
|
||||
superuser: Администратор
|
||||
|
|
|
@ -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 "Не относится к партии"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue