This removes the following two deprecation warnings that we are getting by millions (the two for each controller action test): ``` DEPRECATION WARNING: You are trying to generate the URL for a named route called "main_app" but no such route was found. In the future, this will result in an `ActionController::UrlGenerationError` exception. (called from process_action_with_route at /usr/ src/app/spec/support/controller_requests_helper.rb:49) DEPRECATION WARNING: Passing the `use_route` option in functional tests are deprecated. Support for this option in the `process` method (and the related `get`, `head`, `post`, `patch`, `put` and `delete` helpers) will be removed in the next version without replacement. Functional tests are essentially unit tests for controllers and they should not require knowledge to how the application's routes are configured. Instead, you should explicitly pass the appropiate params to the `process` method. Previously th e engines guide also contained an incorrect example that recommended using this option to test an engine's controllers within the dummy application. That recommendation was incorrect and has since been corrected. Instead, you should override the `@routes` variable in the test case with `Foo::Engine.routes`. See the updated engines guide for details. (called from process_action_with_route at /usr/src/app/spec/support/controller_requests_helper.rb:49) ``` It slows down our test suite and clutters the output a lot. As per my investigation, this is something that arose in https://github.com/rails/rails/pull/17453 and addressed in https://github.com/rails/rails/pull/17725. TL;DR: Engines need to define their routes in controller tests as shown in https://github.com/discourse/discourse/pull/3011. This, however, revealed a much complex reality in our case. We're still using a `Spree::Core::Engine` with its own routes at `Spree::Core::Engine.routes`. So we can't skip defining `routes { }` for each of its controllers unless we merge this engine into our app, but that's going to require more effort. What could that entail in https://github.com/openfoodfoundation/openfoodnetwork/compare/master...coopdevs:move-users-to-app-routes. To make it even worse, note that we override spree's core routes from our own, resulting in a controller whose actions are being served from routes defined in either `config/routes.rb` or `config/spree/routes.rb` 🙈.
Open Food Network
The Open Food Network is an online marketplace for local food. It enables a network of independent online food stores that connects farmers and food hubs (including co-ops, online farmers markets, independent food businesses, etc) with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food.
Supported by the Open Food Foundation and a network of global affiliates, we are proudly open source and not-for-profit - we're trying to seriously disrupt the concentration of power in global agri-food systems, and we need as many smart people working together on this as possible.
We're part of global movement - get involved!
- Join the conversation on Slack. Make sure you introduce yourself in the #general channel and join #dev for all tech-related topics.
- Head to https://openfoodnetwork.org for more information about the global OFN project.
- Check out the User Guide for a list of features and tutorials.
- Join our discussion forum.
Contributing
If you are interested in contributing to the OFN in any capacity, please introduce yourself on Slack, and have a look through the OFN Handbook.
Our GETTING_STARTED and CONTRIBUTING guides are the best place to start for developers looking to set up a development environment and make contributions to the codebase.
Hacktoberfest 🎉
Are you participating in Hacktoberfest? Go check out our Welcome New Developers project board! We have curated all issues we consider to be a good starting point for new members of the community and categorized them by skills and level of complexity. Have a look and pick the one you would prefer working on!
Provisioning
If you're interested in provisioning a server, see ofn-install for the project's Ansible playbooks.
We also have a Super Admin Guide to help with configuration of new servers.
Testing
If you'd like to help out with testing, please introduce yourself on the #testing channel on Slack and download the ZenHub browser extension to view the development pipeline.
We use BrowserStack as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
Licence
Copyright (c) 2012 - 2020 Open Food Foundation, released under the AGPL licence.
