@@ -5,8 +5,6 @@ var fs = require('fs');
55var S = require ( 'string' ) ;
66var ldnode = require ( '../index' ) ;
77
8- var accepts = 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' ;
9-
108describe ( 'formats' , function ( ) {
119 var address = 'http://localhost:3457' ;
1210 var ldp = ldnode . createServer ( {
@@ -18,6 +16,7 @@ describe('formats', function () {
1816 describe ( 'HTML' , function ( ) {
1917 it ( 'Should return "Hello, World!"' , function ( done ) {
2018 server . get ( '/hello.html' )
19+ . set ( 'accept' , 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' )
2120 . expect ( 'Content-type' , / t e x t \/ h t m l / )
2221 . expect ( / H e l l o , w o r l d ! / )
2322 . expect ( 200 , done ) ;
@@ -30,13 +29,13 @@ describe('formats', function () {
3029 } ;
3130 it ( 'Should return JSON-LD document' , function ( done ) {
3231 server . get ( '/patch-5-initial.ttl' )
33- . set ( 'accept' , 'application/ld+json' )
32+ . set ( 'accept' , 'application/ld+json;q=0.9,text/turtle;q=0.8,text/plain;q=0.7,*/*;q=0.5 ' )
3433 . expect ( 'content-type' , / a p p l i c a t i o n \/ l d \+ j s o n / )
3534 . expect ( 200 , done ) ;
3635 } ) ;
3736 it ( 'Should return valid JSON' , function ( done ) {
3837 server . get ( '/patch-5-initial.ttl' )
39- . set ( 'accept' , 'application/ld+json' )
38+ . set ( 'accept' , 'application/ld+json;q=0.9,text/turtle;q=0.8,text/plain;q=0.7,*/*;q=0.5 ' )
4039 . expect ( isValidJSON )
4140 . expect ( 200 , done ) ;
4241 } ) ;
@@ -45,7 +44,7 @@ describe('formats', function () {
4544 describe ( 'N-Quads' , function ( ) {
4645 it ( 'Should return N-Quads document' , function ( done ) {
4746 server . get ( '/patch-5-initial.ttl' )
48- . set ( 'accept' , 'application/n-quads' )
47+ . set ( 'accept' , 'application/n-quads;q=0.9,text/turtle;q=0.8,text/plain;q=0.7,*/*;q=0.5 ' )
4948 . expect ( 'content-type' , / a p p l i c a t i o n \/ n - q u a d s / )
5049 . expect ( 200 , done ) ;
5150 } ) ;
@@ -54,7 +53,7 @@ describe('formats', function () {
5453 describe ( 'n3' , function ( ) {
5554 it ( 'Should return turtle document if content-type set to n3' , function ( done ) {
5655 server . get ( '/patch-5-initial.ttl' )
57- . set ( 'accept' , 'text/n3' )
56+ . set ( 'accept' , 'text/n3;q=0.9,text/turtle;q=0.8,text/plain;q=0.7,*/*;q=0.5 ' )
5857 . expect ( 'content-type' , / t e x t \/ n 3 / )
5958 . expect ( 200 , done ) ;
6059 } ) ;
0 commit comments