Sha256: 9e44448d7dcf1cd7a3e6a7b8b4405aad0196ca1079be960be5c60b5910d44e57

Contents?: true

Size: 1.45 KB

Versions: 33

Compression:

Stored size: 1.45 KB

Contents

Feature: Authentication
  In order to consume the API
  As an admin
  I need to get an authentication token

  Background:
    Given I have the site: "test site" set up

  Scenario: Fail to get a token without an email and a password
    When I post to "/locomotive/api/tokens.json"
    Then the JSON response at "message" should be "The request must contain either the user email and password OR the API key."

  Scenario: Fail to get a token with a wrong password
    When I post to "/locomotive/api/tokens.json" with:
    """
    { "email": "admin@locomotiveapp.org", "password": "wrongone" }
    """
    Then the JSON response at "message" should be "Invalid email or password."

  Scenario: Fail to get a token with a wrong api key
    When I post to "/locomotive/api/tokens.json" with:
    """
    { "api_key": "42" }
    """
    Then the JSON response at "message" should be "The API key is invalid."

  Scenario: Get a token from an email and password
    When I post to "/locomotive/api/tokens.json" with:
    """
    { "email": "admin@locomotiveapp.org", "password": "easyone" }
    """
    Then the JSON response at "token" should be a string
    And the JSON response should not have "message"

  Scenario: Get a token from an API key
    When I post to "/locomotive/api/tokens.json" with:
    """
    { "api_key": "d49cd50f6f0d2b163f48fc73cb249f0244c37074" }
    """
    Then the JSON response at "token" should be a string
    And the JSON response should not have "message"

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
locomotivecms-3.0.0.rc3 features/api/authentication.feature
locomotivecms-3.0.0.rc2 features/api/authentication.feature
locomotivecms-3.0.0.rc1 features/api/authentication.feature
locomotivecms-3.0.0.pre.beta.1 features/api/authentication.feature
locomotivecms-3.0.0.pre.alpha.3 features/api/authentication.feature
locomotive_cms-2.5.7 features/api/authentication.feature
locomotivecms-3.0.0.pre.alpha.2 features/api/authentication.feature
locomotivecms-3.0.0.pre.alpha features/api/authentication.feature
locomotive_cms-2.5.6 features/api/authentication.feature
locomotive_cms-2.5.6.rc2 features/api/authentication.feature
locomotive_cms-2.5.6.rc1 features/api/authentication.feature
locomotive_cms-2.5.5 features/api/authentication.feature
locomotive_cms-2.5.4 features/api/authentication.feature
locomotive_cms-2.5.3 features/api/authentication.feature
locomotive_cms-2.5.2 features/api/authentication.feature
locomotive_cms-2.5.1 features/api/authentication.feature
locomotive_cms-2.5.0 features/api/authentication.feature
locomotive_cms-2.5.0.rc3 features/api/authentication.feature
locomotive_cms-2.5.0.rc2 features/api/authentication.feature
locomotive_cms-2.5.0.rc1 features/api/authentication.feature