Class: TinyGate::TestHelper::UserClient
- Inherits:
-
Object
- Object
- TinyGate::TestHelper::UserClient
- Defined in:
- lib/tiny_gate/test_helper/user_client.rb
Constant Summary collapse
- ROOT_URL =
'http://localhost:31338'
Instance Method Summary collapse
- #add_permission(payload) ⇒ Object
- #add_user(payload) ⇒ Object
-
#initialize(url = ROOT_URL) ⇒ UserClient
constructor
A new instance of UserClient.
- #reset ⇒ Object
Constructor Details
#initialize(url = ROOT_URL) ⇒ UserClient
Returns a new instance of UserClient.
8 9 10 |
# File 'lib/tiny_gate/test_helper/user_client.rb', line 8 def initialize(url = ROOT_URL) @url = url end |
Instance Method Details
#add_permission(payload) ⇒ Object
17 18 19 |
# File 'lib/tiny_gate/test_helper/user_client.rb', line 17 def (payload) HTTP.post(, form: payload) end |
#add_user(payload) ⇒ Object
12 13 14 15 |
# File 'lib/tiny_gate/test_helper/user_client.rb', line 12 def add_user(payload) response = HTTP.post(add_user_url, form: payload) response.body end |
#reset ⇒ Object
21 22 23 |
# File 'lib/tiny_gate/test_helper/user_client.rb', line 21 def reset HTTP.post("#{@url}/reset") end |