Mercurial > hg > soundsoftware-site
comparison test/unit/time_entry_test.rb @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children | e248c7af89ec |
comparison
equal
deleted
inserted
replaced
1297:0a574315af3e | 1298:4f746d8966dd |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2012 Jean-Philippe Lang | 2 # Copyright (C) 2006-2013 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
23 :trackers, :issue_statuses, | 23 :trackers, :issue_statuses, |
24 :projects_trackers, | 24 :projects_trackers, |
25 :journals, :journal_details, | 25 :journals, :journal_details, |
26 :issue_categories, :enumerations, | 26 :issue_categories, :enumerations, |
27 :groups_users, | 27 :groups_users, |
28 :enabled_modules, | 28 :enabled_modules |
29 :workflows | |
30 | 29 |
31 def test_hours_format | 30 def test_hours_format |
32 assertions = { "2" => 2.0, | 31 assertions = { "2" => 2.0, |
33 "21.1" => 21.1, | 32 "21.1" => 21.1, |
34 "2,1" => 2.1, | 33 "2,1" => 2.1, |
109 :user => anon, | 108 :user => anon, |
110 :activity => activity) | 109 :activity => activity) |
111 assert_equal 1, te.errors.count | 110 assert_equal 1, te.errors.count |
112 end | 111 end |
113 | 112 |
113 def test_spent_on_with_2_digits_year_should_not_be_valid | |
114 entry = TimeEntry.new(:project => Project.find(1), :user => User.find(1), :activity => TimeEntryActivity.first, :hours => 1) | |
115 entry.spent_on = "09-02-04" | |
116 assert !entry.valid? | |
117 assert_include I18n.translate('activerecord.errors.messages.not_a_date'), entry.errors[:spent_on] | |
118 end | |
119 | |
114 def test_set_project_if_nil | 120 def test_set_project_if_nil |
115 anon = User.anonymous | 121 anon = User.anonymous |
116 project = Project.find(1) | 122 project = Project.find(1) |
117 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => anon.id, :status_id => 1, | 123 issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => anon.id, :status_id => 1, |
118 :priority => IssuePriority.all.first, :subject => 'test_create', | 124 :priority => IssuePriority.all.first, :subject => 'test_create', |