Skip to content

Commit 20f48e3

Browse files
JonRowebquorning
authored andcommitted
basic spec showing the behaviour of the modified path decorators
1 parent a52dca9 commit 20f48e3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/rspec/rails/view_rendering_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,21 @@ def example.controller
121121
end
122122
end
123123
end
124+
125+
context 'when render_views? is false' do
126+
let(:controller) { ActionController::Base.new }
127+
128+
before { controller.extend(ViewRendering::EmptyTemplates) }
129+
130+
it 'supports manipulating view paths' do
131+
controller.prepend_view_path 'app/views'
132+
controller.append_view_path 'app/others'
133+
expect(controller.view_paths.map(&:to_s)).to match_paths 'app/views', 'app/others'
134+
end
135+
136+
def match_paths(*paths)
137+
eq paths.map { |path| File.expand_path path }
138+
end
139+
end
124140
end
125141
end

0 commit comments

Comments
 (0)