diff options
Diffstat (limited to 'test/unit/time_entry_import_test.rb')
-rw-r--r-- | test/unit/time_entry_import_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/time_entry_import_test.rb b/test/unit/time_entry_import_test.rb index f0ec41cb7..36e7f574d 100644 --- a/test/unit/time_entry_import_test.rb +++ b/test/unit/time_entry_import_test.rb @@ -165,6 +165,28 @@ class TimeEntryImportTest < ActiveSupport::TestCase assert_equal 2, fourth.user_id end + def test_imports_timelogs_for_issues_in_other_project + import = generate_import + import.settings = { + 'separator' => ';', 'wrapper' => '"', 'encoding' => 'UTF-8', + 'mapping' => { + 'project_id' => '3', + 'activity' => 'value:10', + 'issue_id' => '1', + 'spent_on' => '2', + 'hours' => '3', + 'comments' => '4', + 'user' => '7' + } + } + import.save! + first, second, third, fourth = new_records(TimeEntry, 4) {import.run} + assert_equal 3, first.project_id + assert_equal 3, second.project_id + assert_equal 1, third.project_id + assert_equal 1, fourth.project_id + end + protected def generate_import(fixture_name='import_time_entries.csv') |