From 091793265e23452890c6ca27fc64feb54df2ad0b Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 8 Jul 2014 19:08:39 +0200 Subject: move unauthenticated api endpoints into separate feature --- features/unauthenticated.feature | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 features/unauthenticated.feature (limited to 'features/unauthenticated.feature') diff --git a/features/unauthenticated.feature b/features/unauthenticated.feature new file mode 100644 index 0000000..b810bea --- /dev/null +++ b/features/unauthenticated.feature @@ -0,0 +1,31 @@ +Feature: Unauthenticated API endpoints + + Most of the LEAP Provider API requires authentication. + However there are a few exceptions - mostly prerequisits of authenticating. This feature and the authentication feature document these. + + Background: + Given I set headers: + | Accept | application/json | + | Content-Type | application/json | + + @tempfile + Scenario: Fetch provider config + Given the provider config is: + """ + {"config": "me"} + """ + When I send a GET request to "/provider.json" + Then the response status should be "200" + And the response should be: + """ + {"config": "me"} + """ + + Scenario: Authentication required for all other API endpoints + When I send a GET request to "/1/configs" + Then the response status should be "401" + And the response should be: + """ + {"error": "Please log in to perform that action."} + """ + -- cgit v1.2.3 From e86cccb4b89540f3bd403110d051b2723be781b9 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 17 Jul 2014 11:55:31 +0200 Subject: cuke: drop jsonpath, use simple keys instead Also fixed the test for login_required --- features/unauthenticated.feature | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'features/unauthenticated.feature') diff --git a/features/unauthenticated.feature b/features/unauthenticated.feature index b810bea..120274b 100644 --- a/features/unauthenticated.feature +++ b/features/unauthenticated.feature @@ -24,8 +24,6 @@ Feature: Unauthenticated API endpoints Scenario: Authentication required for all other API endpoints When I send a GET request to "/1/configs" Then the response status should be "401" - And the response should be: - """ - {"error": "Please log in to perform that action."} - """ + And the response should have "error" with "not_authorized_login" + And the response should have "message" -- cgit v1.2.3