File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 8585 let ( :guardian ) { Guardian . new ( user ) }
8686
8787 it "returns false when the post user is not in restrict_translation_by_poster_group" do
88- SiteSetting . restrict_translation_by_poster_group = "#{ group . id + 1 } "
88+ SiteSetting . restrict_translation_by_poster_group = "#{ Fabricate ( : group) . id } "
8989
9090 expect ( guardian . can_detect_language? ( post ) ) . to eq ( false )
9191 end
101101 end
102102
103103 it "returns false when the post is a small action post" do
104- post . update ( post_type : Post . types [ :small_action ] )
104+ post . update! ( post_type : Post . types [ :small_action ] )
105105
106106 expect ( guardian . can_detect_language? ( post ) ) . to eq ( false )
107107 end
108108
109109 it "returns false when the post raw is empty" do
110- post . update ( raw : "" )
111-
112- expect ( guardian . can_detect_language? ( post ) ) . to eq ( false )
110+ expect { post . update ( raw : "" ) } . to change { guardian . can_detect_language? ( post ) } . from (
111+ true ,
112+ ) . to ( false )
113113 end
114114 end
115115 end
You can’t perform that action at this time.
0 commit comments