From 10d6eebc69a8668de3575c7562b542d82d09b999 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 20 Aug 2016 18:33:47 -0300 Subject: [PATCH] Ivan - Backend - Add get-settings tests [skip ci] --- tests/init.rb | 1 + tests/run-tests.sh | 2 ++ tests/system/get-settings.rb | 11 +++++++++++ 3 files changed, 14 insertions(+) create mode 100644 tests/system/get-settings.rb diff --git a/tests/init.rb b/tests/init.rb index eef9d99f..3948f566 100644 --- a/tests/init.rb +++ b/tests/init.rb @@ -10,6 +10,7 @@ require './scripts.rb' # TESTS require './system/init-settings.rb' +require './system/get-settings.rb' require './user/signup.rb' require './user/login.rb' require './user/send-recover-password.rb' diff --git a/tests/run-tests.sh b/tests/run-tests.sh index e87ac4ca..f8f7ff17 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -1,2 +1,4 @@ ./clean_db.sh +./clean_db.sh +./clean_db.sh bacon init.rb \ No newline at end of file diff --git a/tests/system/get-settings.rb b/tests/system/get-settings.rb new file mode 100644 index 00000000..437d6ee6 --- /dev/null +++ b/tests/system/get-settings.rb @@ -0,0 +1,11 @@ +describe '/system/get-settings' do + it 'should return correct values' do + result = request('/system/get-settings') + + (result['status']).should.equal('success') + (result['data']['language']).should.equal('en') + (result['data']['departments'][0]).should.equal('Tech Support') + (result['data']['departments'][1]).should.equal('Suggestions') + (result['data']['departments'][2]).should.equal('Sales and Subscriptions') + end +end \ No newline at end of file