File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 9999 expect do
100100 exception = Exception . new ( "error" )
101101 allow ( exception ) . to receive ( :backtrace ) . and_return ( [ "" ] )
102- allow ( WorkGroup ) . to receive ( :find_by_id ) . and_return ( User . all_admins . map ( &:own_group ) . compact )
102+ allow ( WorkGroup ) . to receive ( :find_by_id ) . and_return ( User . all_admins . map ( &:own_group ) . uniq . compact )
103103 Message . send_internal_error_message ( "" , "head" , exception )
104- end . to change { Message . count } . by ( User . all_admins . map ( & :own_group ) . compact . count )
104+ end . to change { Message . count } . by ( User . all_admins . count )
105105 end
106106
107107 it "send a message to all users and admin (admin + normal user)" do
108108 users = [ user ]
109109 expect do
110110 exception = Exception . new ( "error" )
111111 allow ( exception ) . to receive ( :backtrace ) . and_return ( [ "" ] )
112- allow ( WorkGroup ) . to receive ( :find_by_id ) . and_return ( User . all_admins . map ( &:own_group ) . compact )
112+ allow ( WorkGroup ) . to receive ( :find_by_id ) . and_return ( User . all_admins . map ( &:own_group ) . uniq . compact )
113113 Message . send_internal_error_message ( users , "head" , exception )
114- end . to change { Message . count } . by ( User . all_admins . map ( & :own_group ) . compact . count + users . size )
114+ end . to change { Message . count } . by ( User . all_admins . count + users . size )
115115 end
116116
117117 end
You can’t perform that action at this time.
0 commit comments