adding BDD acceptance criteria
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..dae2128
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,31 @@
+docker-compose==1.1.0
+docker-py==0.7.2
+dockerpty==0.3.2
+docopt==0.6.2
+extras==0.0.3
+Flask==0.10.1
+Flask-Classy==0.6.10
+fuzzywuzzy==0.5.0
+ipython==3.0.0
+itsdangerous==0.24
+Jinja2==2.7.3
+lettuce==0.2.20
+linecache2==1.0.0
+MarkupSafe==0.23
+mock==1.0.1
+mockredis==0.1.3.dev0
+python-Levenshtein==0.12.0
+python-mimeparse==0.1.4
+python-subunit==1.1.0
+PyYAML==3.11
+redis==2.10.3
+redis-pubsub-helper==0.1.1
+requests==2.4.3
+six==1.9.0
+sure==1.2.9
+testtools==1.7.1
+texttable==0.8.3
+traceback2==1.4.0
+unittest2==1.0.1
+websocket-client==0.11.0
+Werkzeug==0.10.1
diff --git a/tests/features/publish-a-message.feature b/tests/features/publish-a-message.feature
new file mode 100644
index 0000000..fa6ef7a
--- /dev/null
+++ b/tests/features/publish-a-message.feature
@@ -0,0 +1,8 @@
+Feature: Publish a message
+ In order to test the publish method
+ As a user
+ I will publish a message to a topic
+
+ Scenario: Publish a message to a topic
+ Given I create a new topic using POST /topic0
+ Then I should get a 200 back
diff --git a/tests/features/retrieve-the-next-message-from-a-topic.feature b/tests/features/retrieve-the-next-message-from-a-topic.feature
new file mode 100644
index 0000000..7c7185b
--- /dev/null
+++ b/tests/features/retrieve-the-next-message-from-a-topic.feature
@@ -0,0 +1,46 @@
+
+Feature: Retrieve the next message from a topic
+ In order to test the read_next messages method
+ As a user
+ I will retrieve a message
+
+ Scenario: 200: Retrieval succeeded
+ Given I create a new topic using POST /topic1
+ When I subscribe using POST /topic1/user1
+ And I publish a message 'message1' with a POST /topic1
+ And discard the first 'subscribe' message from /topic1/user1
+ And get new messages using GET /topic1/user1
+ Then I should see 'message1' in the body of the message
+ And I should get a 200 back
+
+ Scenario: 204: No messages available on this topic for this user
+ Given I create a new topic using POST /topic2
+ When I subscribe using POST /topic2/user1
+ And I publish a message 'message1' with a POST /topic1
+ And I publish a message 'message2' with a POST /topic1
+ And I publish a message 'message3' with a POST /topic1
+ And discard the first 'subscribe' message from /topic1/user1
+ And get new messages using GET /topic1/user1
+ And get new messages using GET /topic1/user1
+ And get new messages using GET /topic1/user1
+ Then I should receive nothing
+ And I should get a 204 back
+
+ Scenario: 404: The subscription does not exist
+ Given The subscription does not exist
+ When get new messages using GET /topic1/user1
+ Then I should get a 204 back
+
+ Scenario: Two users, one message, same topic
+ Given I create a new topic using POST /topic3
+ When I subscribe using POST /topic3/user1
+ And I subscribe using POST /topic3/user2
+ And I publish a message 'message1' with a POST /topic3
+ And discard the first 'subscribe' message from /topic3/user1
+ And discard the first 'subscribe' message from /topic3/user2
+ And get new messages using GET /topic3/user1
+ Then I should see 'message1' in the body of the message
+ And I should get a 200 back
+ When get new messages using GET /topic3/user2
+ Then I should see 'message1' in the body of the message
+ And I should get a 200 back
diff --git a/tests/features/subscribe-to-a-topic.feature b/tests/features/subscribe-to-a-topic.feature
new file mode 100644
index 0000000..31e9c34
--- /dev/null
+++ b/tests/features/subscribe-to-a-topic.feature
@@ -0,0 +1,27 @@
+Feature: Subscribe to a topic
+ In order to test the Subscription method
+ As a user
+ I will subscribe to a topic
+
+ Scenario: Subscribe to a topic
+ Given I create a new topic using POST /topic0
+ When I subscribe using POST /topic0/user1
+ Then I should get a 200 back
+
+ Scenario: Two users, one message, same topic
+ Given I create a new topic using POST /topic3
+ When I subscribe using POST /topic3/user1
+ And I subscribe using POST /topic3/user2
+ And I publish a message 'message1' with a POST /topic3
+ And discard the first 'subscribe' message from /topic3/user1
+ And discard the first 'subscribe' message from /topic3/user2
+ And get new messages using GET /topic3/user1
+ Then I should see 'message1' in the body of the message
+ And I should get a 200 back
+ When get new messages using GET /topic3/user2
+ Then I should see 'message1' in the body of the message
+ And I should get a 200 back
+
+
+
+
diff --git a/tests/features/test_helpers.py b/tests/features/test_helpers.py
new file mode 100644
index 0000000..a760cc7
--- /dev/null
+++ b/tests/features/test_helpers.py
@@ -0,0 +1,71 @@
+from lettuce import step, world
+import requests
+import os
+
+endpoint = "http://%s:5000" % os.environ['BOOT2DOCKERIP']
+
+
+@step("I create a new topic using POST /(.*)")
+def create_topic(step, topic):
+ world.message_response = requests.post(
+ '%s/%s' % (endpoint, topic), data='subscribe')
+ assert world.message_response.status_code == 200, \
+ "Got %s" % world.message_response.status_code
+
+
+@step("I publish a message '(.*)' with a POST /(.*)")
+def publish(step, message, topic):
+ world.message_response = requests.post(
+ '%s/%s' % (endpoint, topic), data=message)
+ assert world.message_response.status_code == 200, \
+ "Got %s" % world.message_response.status_code
+
+
+@step("I subscribe using POST /(.*)/(.*)")
+def subscribe(step, topic, user):
+ world.message_response = requests.post(
+ '%s/%s/%s' % (endpoint, topic, user))
+ assert world.message_response.status_code == 200, \
+ "Got %s" % world.message_response.status_code
+
+
+@step("I unsubscribe using DELETE /(.*)/(.*)")
+def unsubscribe(step, topic, user):
+ world.message_response = requests.delete(
+ '%s/%s/%s' % (endpoint, topic, user))
+
+
+@step("get new messages using GET /(.*)/(.*)")
+def read_next(step, topic, user):
+ world.message_response = requests.get(
+ '%s/%s/%s' % (endpoint, topic, user))
+
+
+@step("discard the first 'subscribe' message from /(.*)/(.*)")
+def discard_next(step, topic, user):
+ world.message_response = requests.get(
+ '%s/%s/%s' % (endpoint, topic, user))
+
+
+@step("I should get a (.*) back")
+def check_message_http_code(step, expected):
+ assert world.message_response.status_code == int(expected), \
+ "Got %s" % world.message_response.status_code
+
+
+@step("I should see '(.*)' in the body of the message")
+def check_message_body(step, expected):
+ assert world.message_response.content == expected, \
+ "Got %s" % world.message_response.content
+
+
+@step("I should receive nothing")
+def check_that_I_receive_nothing(step):
+ assert world.message_response.content == '', \
+ "Got %s" % world.message_response.content
+
+
+@step("The subscription does not exist")
+def pass_the_subscription_does_not_exist(step):
+ pass
+
diff --git a/tests/features/test_helpers.pyc b/tests/features/test_helpers.pyc
new file mode 100644
index 0000000..29375ae
--- /dev/null
+++ b/tests/features/test_helpers.pyc
Binary files differ
diff --git a/tests/features/unsubscribe-from-a-topic.feature b/tests/features/unsubscribe-from-a-topic.feature
new file mode 100644
index 0000000..20d04a3
--- /dev/null
+++ b/tests/features/unsubscribe-from-a-topic.feature
@@ -0,0 +1,14 @@
+Feature: Unsubscribe from a topic
+ In order to test the Unsubscribe method
+ As a user
+ I will unsubscribe from a topic
+
+ Scenario: Unsubscribe from a subscribed topic
+ Given I create a new topic using POST /topic0
+ When I subscribe using POST /topic0/user1
+ And I unsubscribe using DELETE /topic0/user1
+ Then I should get a 200 back
+
+ Scenario: Unsubscribe from an unsubscribe topic
+ Given I unsubscribe using DELETE /topic0/user1
+ Then I should get a 404 back