diff --git a/app/views/accounts/show.html.erb b/app/views/accounts/show.html.erb index 057f4ec..c984e87 100644 --- a/app/views/accounts/show.html.erb +++ b/app/views/accounts/show.html.erb @@ -22,6 +22,12 @@ <% end %> + <% if @account.superuser? %> + + <%= translate :superuser %> + + <% end %> +
<% if @account.biography %> diff --git a/config/locales/other/en.yml b/config/locales/other/en.yml index f578016..9aa2198 100644 --- a/config/locales/other/en.yml +++ b/config/locales/other/en.yml @@ -5,3 +5,4 @@ en: current: current :yes: Yes :no: No + superuser: Administrator diff --git a/config/locales/other/ru.yml b/config/locales/other/ru.yml index c37c9cc..cf3feb6 100644 --- a/config/locales/other/ru.yml +++ b/config/locales/other/ru.yml @@ -5,3 +5,4 @@ ru: current: текущее :yes: Да :no: Нет + superuser: Администратор diff --git a/features/desktop/account.feature b/features/desktop/account.feature index 30633ae..b7d552b 100644 --- a/features/desktop/account.feature +++ b/features/desktop/account.feature @@ -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 "Не относится к партии" diff --git a/features/step_definitions/account.rb b/features/step_definitions/account.rb index 226eecb..c42e62a 100644 --- a/features/step_definitions/account.rb +++ b/features/step_definitions/account.rb @@ -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