summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/resources/features_resource.py8
-rw-r--r--service/test/functional/features/login.feature2
-rw-r--r--service/test/functional/features/steps/login.py11
3 files changed, 20 insertions, 1 deletions
diff --git a/service/pixelated/resources/features_resource.py b/service/pixelated/resources/features_resource.py
index 4856b64b..d4b7de7d 100644
--- a/service/pixelated/resources/features_resource.py
+++ b/service/pixelated/resources/features_resource.py
@@ -31,10 +31,16 @@ class FeaturesResource(Resource):
def render_GET(self, request):
disabled_features = self._disabled_features()
- return respond_json({'disabled_features': disabled_features}, request)
+ features = {'disabled_features': disabled_features}
+ self._add_multi_user_to(features)
+ return respond_json(features, request)
def _disabled_features(self):
disabled_features = [default_disabled_feature for default_disabled_feature in self.DISABLED_FEATURES]
if os.environ.get('FEEDBACK_URL') is None:
disabled_features.append('feedback')
return disabled_features
+
+ def _add_multi_user_to(self, features):
+ if self._multi_user:
+ features.update({'multi_user': {'logout': LogoutResource.BASE_URL}})
diff --git a/service/test/functional/features/login.feature b/service/test/functional/features/login.feature
index d22cc774..c50f8eea 100644
--- a/service/test/functional/features/login.feature
+++ b/service/test/functional/features/login.feature
@@ -27,3 +27,5 @@ Feature: login and logout
And I click on the login button
Then I should see the fancy interstitial
Then I have mails
+ When I logout
+ Then I should see the login page
diff --git a/service/test/functional/features/steps/login.py b/service/test/functional/features/steps/login.py
index 7f17567a..e2dc1381 100644
--- a/service/test/functional/features/steps/login.py
+++ b/service/test/functional/features/steps/login.py
@@ -42,3 +42,14 @@ def step_impl(context):
def _wait_for_interstitial_to_reload():
time.sleep(6)
+
+
+@when(u'I logout')
+def click_logout(context):
+ logout_button = wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, 'ul#logout'))
+ logout_button.click()
+
+
+@then(u'I should see the login page')
+def see_login_page(context):
+ assert find_element_by_css_selector(context, 'form#login_form')