File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ module ViewExampleGroup
14
14
module ClassMethods
15
15
def _default_helper
16
16
base = metadata [ :description ] . split ( '/' ) [ 0 ..-2 ] . join ( '/' )
17
- ( base . camelize + 'Helper' ) . constantize if base
17
+ ( base . camelize + 'Helper' ) . constantize unless base . to_s . empty?
18
18
rescue NameError
19
19
nil
20
20
end
Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ module ::Namespaced; module ThingsHelper; end; end
34
34
} . not_to raise_error
35
35
end
36
36
37
+ it 'operates normally when the view has no path and there is a Helper class defined' do
38
+ class ::Helper ; end
39
+ expect {
40
+ RSpec ::Core ::ExampleGroup . describe 'show.html.erb' do
41
+ include ViewExampleGroup
42
+ end
43
+ } . not_to raise_error
44
+ end
45
+
37
46
context 'application helper exists' do
38
47
before do
39
48
if !Object . const_defined? 'ApplicationHelper'
You can’t perform that action at this time.
0 commit comments