Skip to content

Commit

Permalink
Update save sign out integrartion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmaddaford committed Jun 9, 2020
1 parent 2edb55f commit efa62a7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 65 deletions.
20 changes: 10 additions & 10 deletions app/translations/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-06-03 09:10+0100\n"
"POT-Creation-Date: 2020-06-09 13:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -584,12 +584,12 @@ msgstr ""
msgid "Save and sign out"
msgstr ""

#: templates/layouts/configs/_save-sign-out-button.html:18
msgid "Sign out"
#: templates/layouts/configs/_save-sign-out-button.html:7
msgid "Save and complete later"
msgstr ""

#: templates/layouts/configs/_save-sign-out-button.html:32
msgid "Save and complete later"
#: templates/layouts/configs/_save-sign-out-button.html:24
msgid "Sign out"
msgstr ""

#: templates/partials/answer-guidance.html:13
Expand All @@ -607,23 +607,23 @@ msgid ""
" of the section</a>"
msgstr ""

#: templates/partials/question.html:39
#: templates/partials/question.html:48
msgid "Selecting this will clear your answer"
msgstr ""

#: templates/partials/question.html:40
#: templates/partials/question.html:49
msgid "cleared"
msgstr ""

#: templates/partials/question.html:43
#: templates/partials/question.html:52
msgid "Selecting this will deselect any selected options"
msgstr ""

#: templates/partials/question.html:44 templates/partials/question.html:52
#: templates/partials/question.html:53 templates/partials/question.html:61
msgid "deselected"
msgstr ""

#: templates/partials/question.html:48
#: templates/partials/question.html:57
msgid "Or"
msgstr ""

Expand Down

This file was deleted.

48 changes: 48 additions & 0 deletions tests/integration/questionnaire/test_questionnaire_sign_out.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from tests.integration.integration_test_case import IntegrationTestCase


class TestSignOut(IntegrationTestCase):
def test_sign_out_not_signed_in_redirects_to_signed_out_page(self):
self.get("/sign-out")
self.assertInUrl("/signed-out")

def test_sign_out_without_log_out_url_redirects_to_signed_out_page(self):
self.launchSurvey("test_textfield")
self.get("/sign-out")
self.assertInUrl("/signed-out")

def test_sign_out_with_log_out_url_redirects_to_log_out_url(self):
self.launchSurvey(
"test_textfield",
account_service_log_out_url="https://localhost/logout",
)
self.get("/sign-out")
self.assertInUrl("/logout")

def test_sign_out_after_navigating_backwards(self):
# If a user completes a block, then goes back and signs out, on re-authentication
# they should resume on the first incomplete location
self.launchSurvey("test_textfield")
self.post({"name-answer": "Joe Bloggs"})

# Go back to the first page
self.get("/questionnaire/name-block")

self.get("/sign-out")
self.launchSurvey("test_textfield")

# Check we are on the second page
self.assertEqual("/questionnaire/summary", self.last_url)

def test_sign_out_on_section_summary(self):
# If a user completes a section and signs out on the section summary,
# on re-authentication they should resume at the start of the next section
self.launchSurvey("test_section_summary", display_address="test address")
self.post({"insurance-type-answer": "Both"})
self.post({"insurance-address-answer": "Address"})

self.get("/sign-out")
self.launchSurvey("test_section_summary", display_address="test address")

# Check we are at the start of the next section
self.assertInUrl("/questionnaire/house-type/")

0 comments on commit efa62a7

Please sign in to comment.