Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails spec helpers #37

Open
patbenatar opened this issue Oct 25, 2020 · 0 comments
Open

Rails spec helpers #37

patbenatar opened this issue Oct 25, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@patbenatar
Copy link
Owner

patbenatar commented Oct 25, 2020

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(...) }
@patbenatar patbenatar added the enhancement New feature or request label Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant