Skip to content

Commit e9b5ea5

Browse files
author
nicola
committed
adding cors tests
1 parent d9c6e5a commit e9b5ea5

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎test/http.js‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ describe('HTTP APIs', function() {
1414

1515
var server = supertest(address);
1616

17+
describe('CORS are enabled', function() {
18+
it('should have Access-Control-Allow-Origin in header on root container', function(done) {
19+
server.get('/')
20+
.set('Origin', 'http://example.com')
21+
.expect('Access-Control-Allow-Origin', '*')
22+
.expect(200, done);
23+
});
24+
25+
it('should have Access-Control-Allow-Origin in header on other containers', function(done) {
26+
server.get('/sampleContainer')
27+
.set('Origin', 'http://example.com')
28+
.expect('Access-Control-Allow-Origin', '*')
29+
.expect(200, done);
30+
});
31+
32+
it('should have Access-Control-Allow-Origin in header on resources', function(done) {
33+
server.get('/sampleContainer/example1.ttl')
34+
.set('Origin', 'http://example.com')
35+
.expect('Access-Control-Allow-Origin', '*')
36+
.expect(200, done);
37+
});
38+
});
39+
1740
describe('GET Root container', function() {
1841
it('Should exists', function(done) {
1942
server.get('/')

0 commit comments

Comments
 (0)