Просмотр исходного кода

Merge pull request #1237 from sharelatex/spd-open-in-overleaf-zip_uri

Add zip_uri and publisher_slug to Open In Overleaf API

GitOrigin-RevId: 2be4b7a0fe521fc4a4415100ac20190bf6e0df6a
Simon Detheridge 7 лет назад
Родитель
Сommit
22cd3f9273

+ 8 - 0
services/web/test/acceptance/coffee/helpers/MockV1Api.coffee

@@ -36,6 +36,8 @@ module.exports = MockV1Api =
 
 
 	existingEmails: []
 	existingEmails: []
 
 
+	brands: {}
+
 	setAffiliations: (affiliations) -> @affiliations = affiliations
 	setAffiliations: (affiliations) -> @affiliations = affiliations
 
 
 	run: () ->
 	run: () ->
@@ -85,6 +87,12 @@ module.exports = MockV1Api =
 		app.delete "/api/v2/users/:userId/affiliations/:email", (req, res, next) =>
 		app.delete "/api/v2/users/:userId/affiliations/:email", (req, res, next) =>
 			res.sendStatus 204
 			res.sendStatus 204
 
 
+		app.get "/api/v2/brands/:slug", (req, res, next) =>
+			if brand = @brands[req.params.slug]
+				res.json brand
+			else
+				res.sendStatus 404
+
 		app.get '/universities/list', (req, res, next) ->
 		app.get '/universities/list', (req, res, next) ->
 			res.json []
 			res.json []
 
 

+ 1 - 1
services/web/test/unit/coffee/References/ReferencesControllerTests.coffee

@@ -114,7 +114,7 @@ describe "ReferencesController", ->
 					@res.json.calledWith(@fakeResponseData).should.equal true
 					@res.json.calledWith(@fakeResponseData).should.equal true
 					done()
 					done()
 
 
-	describe 'there is no dataaaaaaa', ->
+	describe 'there is no data', ->
 
 
 			beforeEach ->
 			beforeEach ->
 				@ReferencesHandler.indexAll.callsArgWith(1)
 				@ReferencesHandler.indexAll.callsArgWith(1)