File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -166,5 +166,27 @@ def match_paths(*paths)
166
166
eq paths . map { |path | File . expand_path path }
167
167
end
168
168
end
169
+
170
+ context "when a view is rendered in an example group that doesn't include ViewRendering" do
171
+ let ( :view ) do
172
+ ActionView ::Base . new
173
+ end
174
+
175
+ before do
176
+ # We need to set ActiveSupport::LogSubscriber.logger here so that events will be properly logged.
177
+ # https://github.com/rails/rails/blob/v5.1.1/activesupport/lib/active_support/log_subscriber.rb#L83
178
+ logger = double ( 'ActiveSupport::LogSubscriber.logger' ) . as_null_object
179
+ allow ( ActiveSupport ::LogSubscriber ) . to receive ( :logger ) . and_return ( logger )
180
+ end
181
+
182
+ def logger
183
+ ActiveSupport ::LogSubscriber . logger
184
+ end
185
+
186
+ pending 'does not cause an error' do
187
+ expect ( logger ) . not_to receive ( :error ) . with ( a_string_starting_with ( 'Could not log "render_template.action_view" event.' ) )
188
+ view . render ( body : 'foo' )
189
+ end
190
+ end
169
191
end
170
192
end
You can’t perform that action at this time.
0 commit comments