lms4labs/labmanager — pull request #19 by nhocki (2013-02-26 18:29:09+00:00)
Title: Lettuce & Splinter

If we're gonna add some tests, I think we should explore something that will allow us express the flow of the application easily for integration tests. We could use Lettuce which is like Cucumber in rails.

I've added a simple feature of how it would look like [here](https://github.com/lms4labs/labmanager/blob/1c6c379c167d139932be20638e85f59bca73a272/tests/features/authenticate_through_lti.feature) (here's the code, though:)

```cucumber
Feature: Authenticate through lti
In order to gain access to the labs
As a LMS user
I want authenticate using the LTI standard

Scenario: Authenticate with valid credentials
Given a LMS with 'shared' public and 'secret' secret keys
When I authenticate with 'shared' and 'signature'
Then I should be authenticated
Then I should get a "200" http code

Scenario: Authenticate with invalid shared key
Given no LMS
When I authenticate with 'non-existent-shared' and 'signature'
Then I should get a "412" http code

Scenario: Authenticate with invalid signature
Given a LMS with 'shared' public and 'secret' secret keys
When I authenticate with 'shared' and 'wrong-signature'
Then I should get a "403" http code
```

btw, those are *actual tests*, you can "run them" (and right now fail)

What do you think?