@@ -64,7 +64,7 class IssueTest < ActiveSupport::TestCase | |||
|
64 | 64 | issue.reload |
|
65 | 65 | assert_equal 'PostgreSQL', issue.custom_value_for(field).value |
|
66 | 66 | end |
|
67 | ||
|
67 | ||
|
68 | 68 | def test_create_with_group_assignment |
|
69 | 69 | with_settings :issue_group_assignment => '1' do |
|
70 | 70 | assert Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1, :subject => 'Group assignment', :assigned_to_id => 11).save |
@@ -588,12 +588,12 class IssueTest < ActiveSupport::TestCase | |||
|
588 | 588 | # author is not a member of project anymore |
|
589 | 589 | assert !copy.recipients.include?(copy.author.mail) |
|
590 | 590 | end |
|
591 | ||
|
591 | ||
|
592 | 592 | def test_recipients_should_include_the_assigned_group_members |
|
593 | 593 | group_member = User.generate_with_protected! |
|
594 | 594 | group = Group.generate! |
|
595 | 595 | group.users << group_member |
|
596 | ||
|
596 | ||
|
597 | 597 | issue = Issue.find(12) |
|
598 | 598 | issue.assigned_to = group |
|
599 | 599 | assert issue.recipients.include?(group_member.mail) |
@@ -710,22 +710,22 class IssueTest < ActiveSupport::TestCase | |||
|
710 | 710 | assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length, "User #{user_id} appears more or less than once" |
|
711 | 711 | end |
|
712 | 712 | end |
|
713 | ||
|
713 | ||
|
714 | 714 | context "with issue_group_assignment" do |
|
715 | 715 | should "include groups" do |
|
716 | 716 | issue = Issue.new(:project => Project.find(2)) |
|
717 | ||
|
717 | ||
|
718 | 718 | with_settings :issue_group_assignment => '1' do |
|
719 | 719 | assert_equal %w(Group User), issue.assignable_users.map {|a| a.class.name}.uniq.sort |
|
720 | 720 | assert issue.assignable_users.include?(Group.find(11)) |
|
721 | 721 | end |
|
722 | 722 | end |
|
723 | 723 | end |
|
724 | ||
|
724 | ||
|
725 | 725 | context "without issue_group_assignment" do |
|
726 | 726 | should "not include groups" do |
|
727 | 727 | issue = Issue.new(:project => Project.find(2)) |
|
728 | ||
|
728 | ||
|
729 | 729 | with_settings :issue_group_assignment => '0' do |
|
730 | 730 | assert_equal %w(User), issue.assignable_users.map {|a| a.class.name}.uniq.sort |
|
731 | 731 | assert !issue.assignable_users.include?(Group.find(11)) |
@@ -783,23 +783,23 class IssueTest < ActiveSupport::TestCase | |||
|
783 | 783 | assert_equal old_description, detail.old_value |
|
784 | 784 | assert_equal new_description, detail.value |
|
785 | 785 | end |
|
786 | ||
|
786 | ||
|
787 | 787 | def test_blank_descriptions_should_not_be_journalized |
|
788 | 788 | IssueCustomField.delete_all |
|
789 | 789 | Issue.update_all("description = NULL", "id=1") |
|
790 | ||
|
790 | ||
|
791 | 791 | i = Issue.find(1) |
|
792 | 792 | i.init_journal(User.find(2)) |
|
793 | 793 | i.subject = "blank description" |
|
794 | 794 | i.description = "\r\n" |
|
795 | ||
|
795 | ||
|
796 | 796 | assert_difference 'Journal.count', 1 do |
|
797 | 797 | assert_difference 'JournalDetail.count', 1 do |
|
798 | 798 | i.save! |
|
799 | 799 | end |
|
800 | 800 | end |
|
801 | 801 | end |
|
802 | ||
|
802 | ||
|
803 | 803 | def test_description_eol_should_be_normalized |
|
804 | 804 | i = Issue.new(:description => "CR \r LF \n CRLF \r\n") |
|
805 | 805 | assert_equal "CR \r\n LF \r\n CRLF \r\n", i.description |
General Comments 0
You need to be logged in to leave comments.
Login now