Jekyll control panel
====================

First some initial setup code:

    >>> self.loginAsManager()

Viewing the jekyll control panel
--------------------------------

    >>> self.browser.open('http://nohost/plone/@@jekyll-controlpanel')
    >>> self.browser.url.endswith('jekyll-controlpanel')
    True

Click the save button without making any changes:

    >>> self.browser.getControl(name="form.actions.save").click()
    >>> self.browser.url.endswith('jekyll-controlpanel')
    True

Activating just 2 symptoms
--------------------------

    >>> self.browser.open('http://nohost/plone/@@jekyll-controlpanel')
    >>> self.browser.url.endswith('jekyll-controlpanel')
    True

    >>> self.browser.getControl(name='form.activeSymptoms').value = \
    ...     ['collective.jekyll.symptoms.IdFormatSymptom',
    ...      'collective.jekyll.symptoms.TitleLengthSymptom']

Click the save button:

    >>> self.browser.getControl(name="form.actions.save").click()
    >>> self.browser.url.endswith('jekyll-controlpanel')
    True

We should be informed that something has changed:

    >>> 'Changes saved.' in self.browser.contents
    True

Make sure the changes have been applied correctly to the registry:

    >>> records = self.portal.portal_registry.records
    >>> active = records['collective.jekyll.interfaces.IJekyllSettings.activeSymptoms']
    >>> 'collective.jekyll.symptoms.IdFormatSymptom' in active.value
    True
    >>> 'collective.jekyll.symptoms.TitleLengthSymptom' in active.value
    True
    >>> len(active.value)
    2

The viewlet should be available:

    >>> self.browser.open('http://nohost/plone/')
    >>> 'ok' in self.browser.contents
    True

Deactivating all symptoms
-------------------------

    >>> self.browser.open('http://nohost/plone/@@jekyll-controlpanel')
    >>> self.browser.url.endswith('jekyll-controlpanel')
    True

    >>> self.browser.getControl(name='form.activeSymptoms').value = []

Click the save button:

    >>> self.browser.getControl(name="form.actions.save").click()
    >>> self.browser.url.endswith('jekyll-controlpanel')
    True

Make sure the changes have been applied correctly to the registry:

    >>> records = self.portal.portal_registry.records
    >>> active = records['collective.jekyll.interfaces.IJekyllSettings.activeSymptoms']
    >>> len(active.value)
    0

The viewlet shouldn't be available anymore:

    >>> self.browser.open('http://nohost/plone/')
    >>> 'ok' in self.browser.contents
    False
