x-team / the-vault

The Vault Coin counter
MIT License
3 stars 2 forks source link

List by user #24

Closed jacekelgda closed 6 years ago

jacekelgda commented 6 years ago

Admin should be able to list by user

/listvault @username

keremgocen commented 6 years ago

Is this implemented?

If I do /listvault @jacek it shows me;

screen shot 2017-10-27 at 20 11 36

Is this the intended behavour? My guess would be it either should show me an error message since I'm not the admin, or something like You are not authorized to view Jacek's coins, but here are yours...

jacekelgda commented 6 years ago

Scenario: Admin checks other users coin: Given I am "@jacek.lawniczak" user And user "@jacek.lawniczak" is admin And user "@kerem" has "1" coin And user "@jacek.lawniczak" has "1" coin When I run slash command "/listvault @kerem" Then I should see "@kerem has 1 coin."

Scenario: Not admin user checks other users coin: Given I am "@kerem" user And user "@jacek.lawniczak" is admin And user "@jacek.lawniczak" has "1" coin And user "@kerem" has "1" coin When I run slash command "/listvault @jacek.lawniczak" Then I should see "You need to be admin to see other users vault."

Scenario: Not admin user checks other user (that is him) coins: Given I am "@kerem" user And user "@jacek.lawniczak" is admin And user "@jacek.lawniczak" has "1" coin And user "@kerem" has "1" coin When I run slash command "/listvault @kerem" Then I should see "@kerem has 1 coin."

Scenario: Command with no params: Given I am "@kerem" user And user "@jacek.lawniczak" is admin And user "@jacek.lawniczak" has "1" coin And user "@kerem" has "1" coin When I run slash command "/listvault" Then I should see "@kerem has 1 coin."