tests: in backend tests, use POST instead of GET for setText() and setHTML()
This is allowed starting from fc661ee13a
("core: allow URL parameters and POST
bodies to co-exist"), which landed in Etherpad 1.8.0. For the discussion, see
issue #3568.
This commit is contained in:
parent
b2dc446740
commit
352b432ed1
1 changed files with 25 additions and 6 deletions
|
@ -219,7 +219,11 @@ describe('getText', function(){
|
||||||
|
|
||||||
describe('setText', function(){
|
describe('setText', function(){
|
||||||
it('creates a new Pad with text', function(done) {
|
it('creates a new Pad with text', function(done) {
|
||||||
api.get(endPoint('setText')+"&padID="+testPadId+"&text=testTextTwo")
|
api.post(endPoint('setText'))
|
||||||
|
.send({
|
||||||
|
"padID": testPadId,
|
||||||
|
"text": "testTextTwo",
|
||||||
|
})
|
||||||
.expect(function(res){
|
.expect(function(res){
|
||||||
if(res.body.code !== 0) throw new Error("Pad setting text failed");
|
if(res.body.code !== 0) throw new Error("Pad setting text failed");
|
||||||
})
|
})
|
||||||
|
@ -334,7 +338,11 @@ describe('getLastEdited', function(){
|
||||||
|
|
||||||
describe('setText', function(){
|
describe('setText', function(){
|
||||||
it('creates a new Pad with text', function(done) {
|
it('creates a new Pad with text', function(done) {
|
||||||
api.get(endPoint('setText')+"&padID="+testPadId+"&text=testTextTwo")
|
api.post(endPoint('setText'))
|
||||||
|
.send({
|
||||||
|
"padID": testPadId,
|
||||||
|
"text": "testTextTwo",
|
||||||
|
})
|
||||||
.expect(function(res){
|
.expect(function(res){
|
||||||
if(res.body.code !== 0) throw new Error("Pad setting text failed");
|
if(res.body.code !== 0) throw new Error("Pad setting text failed");
|
||||||
})
|
})
|
||||||
|
@ -394,8 +402,11 @@ describe('createPad', function(){
|
||||||
|
|
||||||
describe('setText', function(){
|
describe('setText', function(){
|
||||||
it('Sets text on a pad Id', function(done) {
|
it('Sets text on a pad Id', function(done) {
|
||||||
api.post(endPoint('setText')+"&padID="+testPadId)
|
api.post(endPoint('setText'))
|
||||||
.send({text: text})
|
.send({
|
||||||
|
"padID": testPadId,
|
||||||
|
"text": text,
|
||||||
|
})
|
||||||
.expect(function(res){
|
.expect(function(res){
|
||||||
if(res.body.code !== 0) throw new Error("Pad Set Text failed")
|
if(res.body.code !== 0) throw new Error("Pad Set Text failed")
|
||||||
})
|
})
|
||||||
|
@ -533,7 +544,11 @@ describe('getText', function(){
|
||||||
describe('setHTML', function(){
|
describe('setHTML', function(){
|
||||||
it('Sets the HTML of a Pad attempting to pass ugly HTML', function(done) {
|
it('Sets the HTML of a Pad attempting to pass ugly HTML', function(done) {
|
||||||
var html = "<div><b>Hello HTML</title></head></div>";
|
var html = "<div><b>Hello HTML</title></head></div>";
|
||||||
api.get(endPoint('setHTML')+"&padID="+testPadId+"&html="+html)
|
api.post(endPoint('setHTML'))
|
||||||
|
.send({
|
||||||
|
"padID": testPadId,
|
||||||
|
"html": html,
|
||||||
|
})
|
||||||
.expect(function(res){
|
.expect(function(res){
|
||||||
if(res.body.code !== 1) throw new Error("Allowing crappy HTML to be imported")
|
if(res.body.code !== 1) throw new Error("Allowing crappy HTML to be imported")
|
||||||
})
|
})
|
||||||
|
@ -544,7 +559,11 @@ describe('setHTML', function(){
|
||||||
|
|
||||||
describe('setHTML', function(){
|
describe('setHTML', function(){
|
||||||
it('Sets the HTML of a Pad with complex nested lists of different types', function(done) {
|
it('Sets the HTML of a Pad with complex nested lists of different types', function(done) {
|
||||||
api.get(endPoint('setHTML')+"&padID="+testPadId+"&html="+ulHtml)
|
api.post(endPoint('setHTML'))
|
||||||
|
.send({
|
||||||
|
"padID": testPadId,
|
||||||
|
"html": ulHtml,
|
||||||
|
})
|
||||||
.expect(function(res){
|
.expect(function(res){
|
||||||
if(res.body.code !== 0) throw new Error("List HTML cant be imported")
|
if(res.body.code !== 0) throw new Error("List HTML cant be imported")
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue