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/>.
20 class AssetTest < ActionController::TestCase
22 # test time machine by verifying investment sums at certain dates
24 # this is using the admin user with id_user=>1
27 {:at=>Time.new(2003,5,23), :invested=>225.0},
28 {:at=>Time.new(2004,5,23), :invested=>12245.85},
29 {:at=>Time.new(2014,5,23), :invested=>10570.05},
30 {:at=>Time.new(2014,6,20), :invested=>12068.85},
34 a = Smr::Asset.new(1, ta[:at])
35 assert_in_delta(ta[:invested], a.invested, 0.0001, 'wrong investment total on %s ' % ta[:at])