2017-01-18 23:13:23 +03:00
|
|
|
Feature: LDAP
|
2017-01-19 14:48:50 +03:00
|
|
|
Background:
|
|
|
|
Given using api version "2"
|
2017-01-18 23:13:23 +03:00
|
|
|
|
|
|
|
Scenario: Creating an new, empty configuration
|
|
|
|
Given As an "admin"
|
|
|
|
When sending "POST" to "/apps/user_ldap/api/v1/config"
|
2017-01-19 14:48:50 +03:00
|
|
|
Then the OCS status code should be "200"
|
2017-01-18 23:13:23 +03:00
|
|
|
And the HTTP status code should be "200"
|
2017-01-19 12:04:15 +03:00
|
|
|
And the response should contain a tag "configID"
|
2017-01-19 01:17:58 +03:00
|
|
|
|
|
|
|
Scenario: Delete a non-existing configuration
|
|
|
|
Given As an "admin"
|
|
|
|
When sending "DELETE" to "/apps/user_ldap/api/v1/config/s666"
|
|
|
|
Then the OCS status code should be "404"
|
2017-01-19 14:48:50 +03:00
|
|
|
And the HTTP status code should be "404"
|
2017-01-19 01:17:58 +03:00
|
|
|
|
|
|
|
Scenario: Delete an invalid configuration
|
|
|
|
Given As an "admin"
|
|
|
|
When sending "DELETE" to "/apps/user_ldap/api/v1/config/hack0r"
|
|
|
|
Then the OCS status code should be "400"
|
2017-01-19 14:48:50 +03:00
|
|
|
And the HTTP status code should be "400"
|
2017-01-19 01:17:58 +03:00
|
|
|
|
2017-01-19 12:04:15 +03:00
|
|
|
Scenario: Create and delete a configuration
|
|
|
|
Given As an "admin"
|
2017-01-19 13:09:04 +03:00
|
|
|
And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
|
|
|
|
When deleting the LDAP configuration
|
2017-01-19 14:48:50 +03:00
|
|
|
Then the OCS status code should be "200"
|
2017-01-19 12:04:15 +03:00
|
|
|
And the HTTP status code should be "200"
|
2017-01-19 13:09:04 +03:00
|
|
|
|
|
|
|
Scenario: Create and modify a configuration
|
|
|
|
Given As an "admin"
|
|
|
|
And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
|
|
|
|
When setting "ldapHost" of the LDAP configuration to "ldaps://my.ldap.server"
|
2017-01-19 14:48:50 +03:00
|
|
|
Then the OCS status code should be "200"
|
2017-01-19 13:09:04 +03:00
|
|
|
And the HTTP status code should be "200"
|
|
|
|
# Testing an invalid config key
|
|
|
|
When setting "crack0r" of the LDAP configuration to "foobar"
|
|
|
|
Then the OCS status code should be "400"
|
2017-01-19 14:48:50 +03:00
|
|
|
And the HTTP status code should be "400"
|
2017-01-19 13:09:04 +03:00
|
|
|
|
|
|
|
Scenario: Modiying a non-existing configuration
|
|
|
|
Given As an "admin"
|
|
|
|
When sending "PUT" to "/apps/user_ldap/api/v1/config/s666" with
|
|
|
|
| key | ldapHost |
|
|
|
|
| value | ldaps://my.ldap.server |
|
|
|
|
Then the OCS status code should be "404"
|
2017-01-19 14:48:50 +03:00
|
|
|
And the HTTP status code should be "404"
|