Created
June 21, 2012 05:48
-
-
Save agibralter/2964094 to your computer and use it in GitHub Desktop.
rspec-rails hack for *not* rendering rabl views (no longer necessary as of rabl 0.7.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
# HACK: | |
# https://github.com/rspec/rspec-rails/issues/565#issuecomment-6474362 | |
module RSpec | |
module Rails | |
module ViewRendering | |
class EmptyTemplatePathSetDecorator < ::ActionView::Resolver | |
def find_all(*args) | |
original_path_set.find_all(*args).collect do |template| | |
::ActionView::Template.new( | |
" ", | |
template.identifier, | |
template.handler, | |
{ | |
:virtual_path => template.virtual_path, | |
:format => template.formats | |
} | |
) | |
end | |
end | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HACK: | |
# https://github.com/rspec/rspec-rails/issues/565#issuecomment-6474362 | |
module RSpec | |
module Rails | |
module ViewRendering | |
class HackyHandler | |
def self.call(template) | |
"" | |
end | |
end | |
class EmptyTemplatePathSetDecorator < ::ActionView::Resolver | |
def find_all(*args) | |
original_path_set.find_all(*args).collect do |template| | |
::ActionView::Template.new( | |
"", | |
template.identifier, | |
HackyHandler, # template.handler, | |
{ | |
:virtual_path => template.virtual_path, | |
:format => template.formats | |
} | |
) | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment