diff --git a/features/home_redirect.feature b/features/home_redirect.feature new file mode 100644 index 0000000..d9b7c45 --- /dev/null +++ b/features/home_redirect.feature @@ -0,0 +1,9 @@ + +Feature: Home redirect + In order to be able to choose the home page + As a developer + I want to be able to set a custom redirect when the user access the home page + + Scenario: default configuration for home page + When I access the URL "/" + Then The browser URL should be "/dashboard" diff --git a/features/steps/home.py b/features/steps/home.py new file mode 100644 index 0000000..5896f0f --- /dev/null +++ b/features/steps/home.py @@ -0,0 +1,9 @@ + + +@when(u'I access the URL "{url}"') +def step_impl(context, url): + context.response = context.test.client.get(url) + +@then(u'The browser URL should be "{url}"') +def step_impl(context, url): + context.test.assertRedirects(context.response, url, status_code=301) diff --git a/setup.py b/setup.py index 0b13592..88736c7 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ TEST_REQUIREMENTS = [ 'coveralls>=0.5', 'flake8>=2.3.0', 'mock>=1.0.1', + 'behave_django>=0.2.2', ] diff --git a/tests/colab_settings.py b/tests/colab_settings.py index bf1efa5..62019dc 100644 --- a/tests/colab_settings.py +++ b/tests/colab_settings.py @@ -53,3 +53,7 @@ LOGGING = { } STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' + +from colab.settings import INSTALLED_APPS + +INSTALLED_APPS += ('behave_django', ) -- libgit2 0.21.2