1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/fengmk2-nodeclub

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
test_results.md 3 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
gitlife-traslator Отправлено 02.12.2024 06:27 6f91e8d

/users/top100 должен возвращать статус 200.

app.request().get('/users/top100').end(function (res) {
  res.status.should.equal(200);
  done();
});

/setting должен возвращать статус 302, когда пользователь не авторизован.

app.request().get('/setting').end(function (res) {
  res.status.should.equal(302);
  done();
});

plugins/onehost.js

должен перенаправлять все запросы GET на test.localhost.onehost.com с кодом 301.

app.request().get('/foo/bar').end(function (res) {
  res.status.should.equal(301);
  res.headers.location.should.equal('http://' + bindHost + '/foo/bar');
  done();
});

Должен возвращать код 301 при запросе GET к 127.0.0.1:port.

app.request({ address: '127.0.0.1', port: app.address().port }).get('/foo/bar').end(function (res) {
  res.status.should.equal(301);
  res.headers.location.should.equal('http://' + bindHost + '/foo/bar');
  done();
});

Не должно быть перенаправления для запросов post.

app.request()[method]('/foo/bar').end(function (res) {
  res.status.should.equal(200);
  if (method === 'head') {
    res.body.length.should.be.equal(0);
  } else {
    res.body.toString().should.equal(method.toUpperCase() + ' /foo/bar');
  }
  done();
});

Не должно быть перенаправления для запросов put.

app.request()[method]('/foo/bar').end(function (res) {
  res.status.should.equal(200);
  if (method === 'head') {
    res.body.length.should.be.equal(0);
  } else {
    res.body.toString().should.equal(method.toUpperCase() + ' /foo/bar');
  }
  done();
});

Не должно быть перенаправления для запросов delete.

app.request()[method]('/foo/bar').end(function (res) {
  res.status.should.equal(200);
  if (method === 'head') {
    res.body.length.should.be.equal(0);
  } else {
    res.body.toString().should.equal(method.toUpperCase() + ' /foo/bar');
  }
  done();
});

Не должно быть перенаправления для запросов head.

app.request()[method]('/foo/bar').end(function (res) {
  res.status.should.equal(200);
  if (method === 'head') {
    res.body.length.should.be.equal(0);
  } else {
    res.body.toString().should.equal(method.toUpperCase() + ' /foo/bar');
  }
  done();
});

exclude options

Должен перенаправлять все запросы GET на test.localhost.onehost.com с кодом 301.

app.request().get('/foo/bar').end(function (res) {
  res.status.should.equal(301);
  res.headers.location.should.equal('http://' + bindHost + '/foo/bar');
  done();
});

Должен возвращать статус 200 при запросе GET без хоста.

app2.request({ address: '127.0.0.1', port: 58964 }).get('/foo/bar').end(function (res) {
  res.status.should.equal(200);
  res.body.toString().should.equal('GET /foo/bar');
  done();
});

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/fengmk2-nodeclub.git
git@api.gitlife.ru:oschina-mirror/fengmk2-nodeclub.git
oschina-mirror
fengmk2-nodeclub
fengmk2-nodeclub
master