datopian / ckan-integration-tests

Cypress toolkit to run integration tests against a CKAN instance
https://tech.datopian.com/ckan/
MIT License
4 stars 3 forks source link

Authorization tests should match CKAN default config values #3

Closed higorspinto closed 3 years ago

higorspinto commented 3 years ago

Current Authorization tests are not in line with the CKAN standards config values.

1) Anonymous users should access the main page without being redirect

it('Anonymous user cannot see the UI', () => {
    cy.clearCookies()
    cy.visit('/')
    cy.location().should((loc) => {
      expect(loc.pathname).to.eq('/user/login')
    })
})

2) Self-registration is enabled for anonymous users as the default value for ckan.auth.create_user_via_web is True

it('Self registration is disabled', () => {
    cy.clearCookies()
    cy.request({ url: '/user/register', failOnStatusCode: false }).then((resp) => {
      expect(resp.status).to.eq(403)
    })
})

Acceptance