Merged in OS154-CSV-Import (pull request #128)

Ivan - Add csv file
This commit is contained in:
Ivan Diaz 2017-01-16 22:07:22 -03:00
commit 90d04d9444
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
describe'system/csv-import' do
request('/user/logout')
Scripts.login($staff[:email], $staff[:password], true)
it 'should create user with csv-import' do
file = File.new('../server/files/test.csv', 'w+')
file.puts('prueba1@hotmail.com, contrasena1,ma')
file.puts('prueba2@hotmail.com,contrasena2,max')
file.puts('prueba3@hotmail.com,contrasena3,maxi')
file.close
result= request('/system/csv-import', {
csrf_userid: $csrf_userid,
csrf_token: $csrf_token,
file: File.open( "../server/files/test.csv")
})
(result['status']).should.equal('success')
row = $database.getRow('user', 'prueba1@hotmail.com', 'email')
(row['name']).should.equal('ma')
row = $database.getRow('user', 'prueba2@hotmail.com', 'email')
(row['name']).should.equal('max')
row = $database.getRow('user', 'prueba3@hotmail.com', 'email')
(row['name']).should.equal('maxi')
end
end