Is the best way to get a real-world view context in there to do something
like:
Blah.new(ActionView::Base.new) ?
Or does RSpec have something magical already setup for this sort of thing?
Nope. rspec-rails doesn’t know that you want to write presenters
I’d say just go w/ the real deal.
Ok cool, thanks. It turns out ActionView::Base.new is a bit of a pain
to try to
use in this case since it lacks configuration of view paths and such.
So what
appears to be the simplest way to get this functionality is to do:
//If you have your spec in the directory “spec/presenters”
config.include ActionView::TestCase::Behavior, example_group:
{file_path: %r{spec/presenters}}
Then you can use a method, :view, that you can use as the view context
like this