Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#394 first spike of checking for existing files when creating a new file
- Loading branch information
Showing
5 changed files
with
156 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
describe("Wiki", function () { | ||
|
||
var fileNameParentData = [ | ||
{ | ||
path: "foo.xml", | ||
expectedName: "foo.xml", | ||
expectedPath: "" | ||
}, | ||
{ | ||
path: "/foo.xml", | ||
expectedName: "foo.xml", | ||
expectedPath: "/" | ||
}, | ||
{ | ||
path: "/foo/foo.xml", | ||
expectedName: "foo.xml", | ||
expectedPath: "/foo" | ||
}, | ||
{ | ||
path: "/foo/bar/foo.xml", | ||
expectedName: "foo.xml", | ||
expectedPath: "/foo/bar" | ||
} | ||
]; | ||
|
||
angular.forEach(fileNameParentData, function (sample) { | ||
var path = sample.path; | ||
var expectedName = sample.expectedName; | ||
var expectedParent = sample.expectedParent; | ||
|
||
it("file name and parent on path " + path), function () { | ||
expect(expectedName).toEqual(Wiki.fileName(path)); | ||
expect(expectedParent).toEqual(Wiki.fileParent(path)); | ||
}; | ||
}); | ||
|
||
}); |