12
12
let ( :pm_post ) { Fabricate ( :private_message_post ) }
13
13
let ( :pm ) { pm_post . topic }
14
14
15
- context "assigning and unassigning" do
15
+ describe "assigning and unassigning" do
16
16
let ( :post ) { Fabricate ( :post ) }
17
17
let ( :topic ) { post . topic }
18
18
let ( :secure_category ) { Fabricate ( :private_category , group : Fabricate ( :group ) ) }
53
53
expect {
54
54
described_class . new ( topic , admin ) . assign ( moderator_2 )
55
55
} . to change { moderator . notifications . count } . by ( -1 )
56
- . and change { moderator_2 . notifications . count } . by ( 1 )
56
+ . and change { moderator_2 . notifications . count } . by ( 1 )
57
57
end
58
58
59
59
it "can assign with note" do
@@ -186,7 +186,7 @@ def assigned_to?(assignee)
186
186
assigner . assign ( assignee ) . fetch ( :success )
187
187
end
188
188
189
- context "forbidden reasons" do
189
+ describe "forbidden reasons" do
190
190
it "doesn't assign if the topic has more than 5 assignments" do
191
191
other_post = nil
192
192
@@ -487,7 +487,7 @@ def assigned_to?(assignee)
487
487
end
488
488
end
489
489
490
- context "assign_self_regex" do
490
+ describe "assign_self_regex" do
491
491
fab! ( :me ) { Fabricate ( :admin ) }
492
492
fab! ( :op ) { Fabricate ( :post ) }
493
493
fab! ( :reply ) do
@@ -528,7 +528,7 @@ def assigned_to?(assignee)
528
528
end
529
529
end
530
530
531
- context "assign_other_regex" do
531
+ describe "assign_other_regex" do
532
532
fab! ( :me ) { Fabricate ( :admin ) }
533
533
fab! ( :other ) { Fabricate ( :admin ) }
534
534
fab! ( :op ) { Fabricate ( :post ) }
@@ -553,12 +553,12 @@ def assigned_to?(assignee)
553
553
end
554
554
end
555
555
556
- context "unassign_on_close" do
556
+ describe "unassign_on_close" do
557
557
let ( :post ) { Fabricate ( :post ) }
558
558
let ( :topic ) { post . topic }
559
559
let ( :moderator ) { Fabricate ( :moderator ) }
560
560
561
- context "topic" do
561
+ context "with topic" do
562
562
let ( :assigner ) { described_class . new ( topic , moderator ) }
563
563
564
564
before do
@@ -595,7 +595,7 @@ def assigned_to?(assignee)
595
595
end
596
596
end
597
597
598
- context "post" do
598
+ context "with post" do
599
599
let ( :post_2 ) { Fabricate ( :post , topic : topic ) }
600
600
let ( :assigner ) { described_class . new ( post_2 , moderator ) }
601
601
let ( :post_3 ) { Fabricate ( :post , topic : topic ) }
@@ -650,12 +650,12 @@ def assigned_to?(assignee)
650
650
end
651
651
end
652
652
653
- context "reassign_on_open" do
653
+ describe "reassign_on_open" do
654
654
let ( :post ) { Fabricate ( :post ) }
655
655
let ( :topic ) { post . topic }
656
656
let ( :moderator ) { Fabricate ( :moderator ) }
657
657
658
- context "topic" do
658
+ describe "topic" do
659
659
let ( :assigner ) { described_class . new ( topic , moderator ) }
660
660
661
661
before do
@@ -677,7 +677,7 @@ def assigned_to?(assignee)
677
677
end
678
678
end
679
679
680
- context "post" do
680
+ context "with post" do
681
681
let ( :post_2 ) { Fabricate ( :post , topic : topic ) }
682
682
let ( :assigner ) { described_class . new ( post_2 , moderator ) }
683
683
@@ -702,7 +702,7 @@ def assigned_to?(assignee)
702
702
end
703
703
end
704
704
705
- context "assign_emailer" do
705
+ describe "assign_emailer" do
706
706
let ( :post ) { Fabricate ( :post ) }
707
707
let ( :topic ) { post . topic }
708
708
let ( :moderator ) { Fabricate ( :moderator ) }
@@ -719,9 +719,9 @@ def assigned_to?(assignee)
719
719
it "doesn't send an email if assignee is a group" do
720
720
SiteSetting . assign_mailer = AssignMailer . levels [ :always ]
721
721
722
- expect { described_class . new ( topic , moderator ) . assign ( assign_allowed_group ) } . to change {
722
+ expect { described_class . new ( topic , moderator ) . assign ( assign_allowed_group ) } . not_to change {
723
723
ActionMailer ::Base . deliveries . size
724
- } . by ( 0 )
724
+ }
725
725
end
726
726
727
727
it "doesn't send an email if the assigner and assignee are not different" do
@@ -735,17 +735,17 @@ def assigned_to?(assignee)
735
735
it "doesn't send an email if the assigner and assignee are not different" do
736
736
SiteSetting . assign_mailer = AssignMailer . levels [ :different_users ]
737
737
738
- expect { described_class . new ( topic , moderator ) . assign ( moderator ) } . to change {
738
+ expect { described_class . new ( topic , moderator ) . assign ( moderator ) } . not_to change {
739
739
ActionMailer ::Base . deliveries . size
740
- } . by ( 0 )
740
+ }
741
741
end
742
742
743
743
it "doesn't send an email" do
744
744
SiteSetting . assign_mailer = AssignMailer . levels [ :never ]
745
745
746
- expect { described_class . new ( topic , moderator ) . assign ( moderator_2 ) } . to change {
746
+ expect { described_class . new ( topic , moderator ) . assign ( moderator_2 ) } . not_to change {
747
747
ActionMailer ::Base . deliveries . size
748
- } . by ( 0 )
748
+ }
749
749
end
750
750
end
751
751
end
0 commit comments