(Guillermo) add ruby testing for user-edit [skip ci]

This commit is contained in:
AntonyAntonio 2016-08-09 23:54:39 -03:00
parent 9e778f2c90
commit 23604cc713
4 changed files with 8 additions and 8 deletions

View File

@ -18,5 +18,4 @@ $userControllers->addController(new RecoverPasswordController);
$userControllers->addController(new EditPassword);
$userControllers->addController(new EditEmail);
$userControllers->finalize();

View File

@ -15,6 +15,7 @@ class EditEmail extends Controller{
]
];
}
public function handler() {
$newEmail = Controller::request('newEmail');
$user = Controller::getLoggedUser();

View File

@ -15,7 +15,7 @@ describe '/user/edit-email' do
newEmail: 'newemail@jobscom',
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('fail')
(result['message']).should.equal('Invalid email')
@ -23,7 +23,7 @@ describe '/user/edit-email' do
newEmail: 'newemailjobs.com',
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('fail')
(result['message']).should.equal('Invalid email')
end
@ -33,7 +33,7 @@ describe '/user/edit-email' do
newEmail: 'newemail@jobs.com',
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('success')
end
end

View File

@ -16,7 +16,7 @@ describe '/user/edit-password' do
newPassword: 'np',
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('fail')
(result['message']).should.equal('Invalid password')
@ -28,7 +28,7 @@ describe '/user/edit-password' do
newPassword: long_text,
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('fail')
(result['message']).should.equal('Invalid password')
end
@ -39,7 +39,7 @@ describe '/user/edit-password' do
newPassword: 'newpassword',
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('fail')
(result['message']).should.equal('Invalid old password')
end
@ -50,7 +50,7 @@ describe '/user/edit-password' do
newPassword: 'newpassword',
csrf_userid: $csrf_userid,
csrf_token: $csrf_token
})
})
(result['status']).should.equal('success')
end
end