rbexy
rbexy copied to clipboard
Rails spec helpers
Currently using rspec-rails controller specs with anonymous controllers in order to get a view context. eg:
# Make this a controller spec for easy access to an ActionView context
RSpec.describe AtomicComponent::Base, type: :controller do
controller(ActionController::Base) {}
let(:view_context) { controller.view_context }
# ...
end
Would be nice to get this context more easily. Maybe we add a type: :component
for rspec?
Also a helper to add to context. Currently doing:
before { view_context.rbexy_context.last[:form] = double(...) }