2 # This file is part of SMR.
4 # SMR is free software: you can redistribute it and/or modify it under the
5 # terms of the GNU General Public License as published by the Free Software
6 # Foundation, either version 3 of the License, or (at your option) any later
9 # SMR is distributed in the hope that it will be useful, but WITHOUT ANY
10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along with
14 # SMR. If not, see <http://www.gnu.org/licenses/>.
18 class SmrAssetTest < ActionController::TestCase
21 # test time machine by verifying investment sums at certain dates
23 # this is using the admin user with id_user=>1
26 {:at=>Time.new(2003,5,23), :invested=>225.0},
27 {:at=>Time.new(2004,5,23), :invested=>7162.95},
28 {:at=>Time.new(2014,5,23), :invested=>10570.05},
29 {:at=>Time.new(2014,6,20), :invested=>12068.85},
33 a = SmrAsset.new(1, ta[:at])
34 assert_equal a.invested, ta[:invested], 'wrong investment total at %s' % ta[:at]