"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/unit/time_entry_import_test.rb" between
redmine-4.1.0.tar.gz and redmine-4.1.1.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

time_entry_import_test.rb  (redmine-4.1.0):time_entry_import_test.rb  (redmine-4.1.1)
skipping to change at line 130 skipping to change at line 130
import.save! 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', first.custom_field_value(overtime_cf)
assert_equal '1', second.custom_field_value(overtime_cf) assert_equal '1', second.custom_field_value(overtime_cf)
assert_equal '0', third.custom_field_value(overtime_cf) assert_equal '0', third.custom_field_value(overtime_cf)
assert_equal '0', fourth.custom_field_value(overtime_cf) assert_equal '0', fourth.custom_field_value(overtime_cf)
end end
def test_maps_user_id_for_user_with_permissions def test_maps_user_id_for_user_with_permissions
User.current = User.find(1) Role.find_by_name('Manager').add_permission! :log_time_for_other_users
import = generate_import_with_mapping 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, first.user_id
assert_equal 2, second.user_id assert_equal 2, second.user_id
assert_equal 3, third.user_id assert_equal 3, third.user_id
assert_equal 2, fourth.user_id assert_equal 2, fourth.user_id
end end
def test_maps_user_to_column_value def test_maps_user_to_column_value
User.current = User.find(1) Role.find_by_name('Manager').add_permission! :log_time_for_other_users
import = generate_import_with_mapping import = generate_import_with_mapping
import.mapping.merge!('user_id' => 'value:1') import.mapping.merge!('user_id' => 'value:3')
import.save! 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.user_id assert_equal 3, first.user_id
assert_equal 1, second.user_id assert_equal 3, second.user_id
assert_equal 1, third.user_id assert_equal 3, third.user_id
assert_equal 1, fourth.user_id assert_equal 3, fourth.user_id
end end
def test_maps_user_id_for_user_without_permissions def test_maps_user_id_for_user_without_permissions
# User 2 doesn't have log_time_for_other_users permission # User 2 doesn't have log_time_for_other_users permission
User.current = User.find(2) User.current = User.find(2)
import = generate_import_with_mapping 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, first.user_id
assert_equal 2, second.user_id assert_equal 2, second.user_id
 End of changes. 4 change blocks. 
7 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)