def test_maps_issue_id
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_nil first.issue_id
assert_nil second.issue_id
def test_maps_date
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal Date.new(2020, 1, 1), first.spent_on
assert_equal Date.new(2020, 1, 2), second.spent_on
def test_maps_hours
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal 1, first.hours
assert_equal 2, second.hours
def test_maps_comments
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal 'Some Design', first.comments
assert_equal 'Some Development', second.comments
import.save!
# N.B. last row is not imported due to the usage of a disabled activity
- first, second, third = new_records(TimeEntry, 3) { import.run }
+ first, second, third = new_records(TimeEntry, 3) {import.run}
assert_equal 9, first.activity_id
assert_equal 10, second.activity_id
def test_maps_activity_to_fixed_value
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal 10, first.activity_id
assert_equal 10, second.activity_id
import = generate_import_with_mapping
import.mapping['cf_10'] = '6'
import.save!
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal '1', first.custom_field_value(overtime_cf)
assert_equal '1', second.custom_field_value(overtime_cf)
Role.find_by_name('Manager').add_permission! :log_time_for_other_users
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal 2, first.user_id
assert_equal 2, second.user_id
import = generate_import_with_mapping
import.mapping['user'] = 'value:3'
import.save!
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal 3, first.user_id
assert_equal 3, second.user_id
# User 2 doesn't have log_time_for_other_users permission
User.current = User.find(2)
import = generate_import_with_mapping
- first, second, third, fourth = new_records(TimeEntry, 4) { import.run }
+ first, second, third, fourth = new_records(TimeEntry, 4) {import.run}
assert_equal 2, first.user_id
assert_equal 2, second.user_id