Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More acceptance tests

  • Loading branch information...
commit ff44e52511c0b01cb06ece264c9bf9f82066f6da 1 parent 308d877
Tobias Pfeiffer authored
Showing with 18 additions and 2 deletions.
  1. +6 −2 spec/recommender.spec.coffee
  2. +12 −0 spec/serverAcceptance.spec.coffee
8 spec/recommender.spec.coffee
View
@@ -31,9 +31,13 @@ describe 'Recommender', ->
describe 'findRecommendations', ->
+ beforeEach -> @recommendations = @recommender.findRecommendations(requestObject())
+
it 'responds with an array of an appropriate size', ->
- recommendations = @recommender.findRecommendations(requestObject())
- expect(recommendations.length).toEqual LIMIT
+ expect(@recommendations.length).toEqual LIMIT
+
+ it 'respondes with an array where every element is an object with an id', ->
+ _.each @recommendations, (item) -> expect(item.id).toBeDefined()
12 spec/serverAcceptance.spec.coffee
View
@@ -49,4 +49,16 @@ describe 'Acceptance tests for server and recommendation engine', ->
helper.sendAndExpect testJSON(), (responseObject) ->
expect(responseObject.items).toEqual([])
+ it 'sets the correct version number', ->
+ helper.sendAndExpect testJSON(), (responseObject) ->
+ expect(responseObject.version).toEqual("1.0")
+
+ it 'sets the correct tem id', ->
+ helper.sendAndExpect testJSON(), (responseObject) ->
+ expect(responseObject.team.id).toEqual(2)
+
+ it 'sets the right msg type', ->
+ helper.sendAndExpect testJSON(), (responseObject) ->
+ expect(responseObject.msg).toEqual('result')
+
runs -> helper.stopServer()
Please sign in to comment.
Something went wrong with that request. Please try again.