Skip to content

Commit

Permalink
CV2-3940: fix default language for duplicated team (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy authored Nov 9, 2023
1 parent 558bcd3 commit 7770a06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/concerns/team_duplication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def self.modify_settings(old_team, new_team)
new_list_columns = old_team.get_list_columns.to_a.collect{|lc| lc.include?("task_value_") ? "task_value_#{team_task_map[lc.split("_").last.to_i]}" : lc}
new_team.set_list_columns = new_list_columns unless new_list_columns.blank?
new_team.set_languages = old_team.get_languages
new_team.set_language = old_team.get_language
new_team
end

Expand Down
10 changes: 10 additions & 0 deletions test/models/team_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,16 @@ def setup
assert_equal ['alegre'], tbi.map(&:user).map(&:login)
end

test "should duplicate team with non english default language" do
t1 = create_team
t1.set_languages = ['fr']
t1.set_language = 'fr'
t1.save!
t2 = Team.duplicate(t1)
assert_equal ['fr'], t2.get_languages
assert_equal 'fr', t2.get_language
end

test "should delete team and partition" do
t = create_team
assert_difference 'Team.count', -1 do
Expand Down

0 comments on commit 7770a06

Please sign in to comment.