|
@@ -140,11 +140,16 @@ describe 'ProjectDetailsHandler', ->
|
|
|
expect(error).to.exist
|
|
expect(error).to.exist
|
|
|
done()
|
|
done()
|
|
|
|
|
|
|
|
- it "should reject empty names with /s", (done) ->
|
|
|
|
|
|
|
+ it "should reject names with /s", (done) ->
|
|
|
@handler.validateProjectName "foo/bar", (error) ->
|
|
@handler.validateProjectName "foo/bar", (error) ->
|
|
|
expect(error).to.exist
|
|
expect(error).to.exist
|
|
|
done()
|
|
done()
|
|
|
|
|
|
|
|
|
|
+ it "should reject names with \\s", (done) ->
|
|
|
|
|
+ @handler.validateProjectName "foo\\bar", (error) ->
|
|
|
|
|
+ expect(error).to.exist
|
|
|
|
|
+ done()
|
|
|
|
|
+
|
|
|
it "should reject long names", (done) ->
|
|
it "should reject long names", (done) ->
|
|
|
@handler.validateProjectName new Array(1000).join("a"), (error) ->
|
|
@handler.validateProjectName new Array(1000).join("a"), (error) ->
|
|
|
expect(error).to.exist
|
|
expect(error).to.exist
|
|
@@ -204,6 +209,9 @@ describe 'ProjectDetailsHandler', ->
|
|
|
it "should replace / with -", () ->
|
|
it "should replace / with -", () ->
|
|
|
expect(@handler.fixProjectName "foo/bar").to.equal "foo-bar"
|
|
expect(@handler.fixProjectName "foo/bar").to.equal "foo-bar"
|
|
|
|
|
|
|
|
|
|
+ it "should replace \\ with ''", () ->
|
|
|
|
|
+ expect(@handler.fixProjectName "foo \\ bar").to.equal "foo bar"
|
|
|
|
|
+
|
|
|
it "should truncate long names", () ->
|
|
it "should truncate long names", () ->
|
|
|
expect(@handler.fixProjectName new Array(1000).join("a")).to.equal "a".repeat(150)
|
|
expect(@handler.fixProjectName new Array(1000).join("a")).to.equal "a".repeat(150)
|
|
|
|
|
|