File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 6767 expect ( serialized ) . to include ( location : resource . extended_data [ "location" ] )
6868 end
6969
70+ context "when users are blocked" do
71+ let ( :resource ) { create ( :user , :blocked , extended_data : registration_metadata , blocked_at :) }
72+ let ( :blocked_at ) { Time . zone . now }
73+ let ( :blocking_user ) { create ( :user , :admin , :confirmed , organization : resource . organization ) }
74+ let ( :blocking_justification ) { "This is a spam user with suspicious activities" }
75+ let ( :user_block ) { double ( justification : blocking_justification ) }
76+
77+ before do
78+ allow ( resource ) . to receive ( :blocking ) . and_return ( user_block )
79+ end
80+
81+ it "includes the blocked status and justification" do
82+ expect ( serialized ) . to include ( blocked : true )
83+ expect ( serialized ) . to include ( blocked_at :)
84+ expect ( serialized ) . to include ( blocking_justification :)
85+ end
86+ end
87+
7088 # Block ExtraUserFields IncludeExtraField
7189
7290 # EndBlock
You can’t perform that action at this time.
0 commit comments