mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Restructure source code folder
This way the location of certain classes should make more sense
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { RedirectResponseDescription } from '../../../../../src/http/output/response/RedirectResponseDescription';
|
||||
import { SOLID_HTTP } from '../../../../../src/util/Vocabularies';
|
||||
|
||||
describe('A RedirectResponseDescription', (): void => {
|
||||
const location = 'http://test.com/foo';
|
||||
|
||||
it('has status code 302 and a location.', async(): Promise<void> => {
|
||||
const description = new RedirectResponseDescription(location);
|
||||
expect(description.metadata?.get(SOLID_HTTP.terms.location)?.value).toBe(location);
|
||||
expect(description.statusCode).toBe(302);
|
||||
});
|
||||
|
||||
it('has status code 301 if the change is permanent.', async(): Promise<void> => {
|
||||
const description = new RedirectResponseDescription(location, true);
|
||||
expect(description.metadata?.get(SOLID_HTTP.terms.location)?.value).toBe(location);
|
||||
expect(description.statusCode).toBe(301);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user