|
@@ -4,11 +4,14 @@ var tape = require("tape"),
|
4
|
4
|
queue = require("d3").queue,
|
5
|
5
|
request = require("supertest");
|
6
|
6
|
|
|
7
|
+var fonts = require("../lib/settings/").fonts;
|
|
8
|
+
|
7
|
9
|
var serverSettings = require("./patch-settings")({
|
8
|
10
|
workingDirectory: path.join(__dirname, "tmp", "working"),
|
9
|
11
|
maxUploadSize: 100000,
|
10
|
12
|
storagePath: path.join(__dirname, "tmp", "storage"),
|
11
|
|
- worker: true
|
|
13
|
+ worker: true,
|
|
14
|
+ fonts: fonts
|
12
|
15
|
});
|
13
|
16
|
|
14
|
17
|
var server = require("../server");
|
|
@@ -66,6 +69,44 @@ tape("404 2", function(test) {
|
66
|
69
|
|
67
|
70
|
});
|
68
|
71
|
|
|
72
|
+tape("404 3", function(test) {
|
|
73
|
+
|
|
74
|
+ request(server)
|
|
75
|
+ .get("/fonts/something")
|
|
76
|
+ .expect(404)
|
|
77
|
+ .end(function(err, res){
|
|
78
|
+ test.error(err);
|
|
79
|
+ test.end();
|
|
80
|
+ });
|
|
81
|
+
|
|
82
|
+});
|
|
83
|
+
|
|
84
|
+tape("Font stylesheet", function(test) {
|
|
85
|
+
|
|
86
|
+ request(server)
|
|
87
|
+ .get("/fonts/fonts.css")
|
|
88
|
+ .expect(200)
|
|
89
|
+ .expect("Content-Type", /css/)
|
|
90
|
+ .end(function(err, res){
|
|
91
|
+ test.error(err);
|
|
92
|
+ test.end();
|
|
93
|
+ });
|
|
94
|
+
|
|
95
|
+});
|
|
96
|
+
|
|
97
|
+tape("Font file", function(test) {
|
|
98
|
+
|
|
99
|
+ request(server)
|
|
100
|
+ .get("/fonts/custom-0.ttf")
|
|
101
|
+ .expect(200)
|
|
102
|
+ .expect("Content-Type", /ttf/)
|
|
103
|
+ .end(function(err, res){
|
|
104
|
+ test.error(err);
|
|
105
|
+ test.end();
|
|
106
|
+ });
|
|
107
|
+
|
|
108
|
+});
|
|
109
|
+
|
69
|
110
|
tape("Server static background", function(test) {
|
70
|
111
|
|
71
|
112
|
request(server)
|