Ivan - Fix issues with mail templating and add it to ruby tests [skip ci]
This commit is contained in:
parent
4ccbd75759
commit
3f01526814
|
@ -12,7 +12,7 @@ class MailTemplate extends DataStore {
|
|||
|
||||
$bean = RedBean::findOne(MailTemplate::TABLE, 'type = :type AND language = :language', array(
|
||||
':type' => $type,
|
||||
':language' => $globalLanguage
|
||||
':language' => $globalLanguage->value
|
||||
));
|
||||
|
||||
return ($bean) ? new MailTemplate($bean) : null;
|
||||
|
@ -22,6 +22,7 @@ class MailTemplate extends DataStore {
|
|||
return [
|
||||
'type',
|
||||
'subject',
|
||||
'language',
|
||||
'body'
|
||||
];
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ class Setting extends DataStore {
|
|||
const TABLE = 'setting';
|
||||
|
||||
public static function getSetting($name) {
|
||||
return parent::getDataStore('name', $name);
|
||||
return parent::getDataStore($name, 'name');
|
||||
}
|
||||
|
||||
public static function getProps() {
|
||||
|
|
|
@ -5,7 +5,7 @@ include_once 'tests/__mocks__/ResponseMock.php';
|
|||
include_once 'tests/__mocks__/ControllerMock.php';
|
||||
include_once 'tests/__mocks__/SessionMock.php';
|
||||
include_once 'tests/__mocks__/UserMock.php';
|
||||
include_once 'models/ERRORS.php';
|
||||
include_once 'data/ERRORS.php';
|
||||
|
||||
include_once 'controllers/user/login.php';
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ require './libs.rb'
|
|||
require './scripts.rb'
|
||||
|
||||
# TESTS
|
||||
require './system/init-settings.rb'
|
||||
require './user/signup.rb'
|
||||
require './user/login.rb'
|
||||
require './user/send-recover-password.rb'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
def request(path, data)
|
||||
def request(path, data = {})
|
||||
uri = URI('http://localhost:8080' + path)
|
||||
response = Net::HTTP.post_form(uri, data)
|
||||
|
||||
|
@ -8,8 +8,8 @@ end
|
|||
|
||||
class Database
|
||||
def initialize()
|
||||
mysqlUser = ENV['MYSQL_USER'] || 'root';
|
||||
mysqlPass = ENV['MYSQL_PASSWORD'] || '';
|
||||
mysqlUser = ENV['MYSQL_USER'] || 'root'
|
||||
mysqlPass = ENV['MYSQL_PASSWORD'] || ''
|
||||
@connection = Mysql.new('localhost', mysqlUser , mysqlPass, 'development')
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
describe '/system/init-settings' do
|
||||
it 'should initialize correctly' do
|
||||
result = request('/system/init-settings')
|
||||
|
||||
lang = $database.getRow('setting', 'language', 'name')
|
||||
|
||||
(result['status']).should.equal('success')
|
||||
(lang['value']).should.equal('en')
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue