-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix component locale stubs #159
Merged
Merged
Conversation
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
The headers sent are not important in this context. We want to stub all requests to these resources regardless of the headers sent.
Adds a helper that configures slimmer to behave correctly in a test environment.
andrewgarner
force-pushed
the
fix-component-locale-stubs
branch
from
August 10, 2016 07:24
adf25c8
to
bdc2f88
Compare
tijmenb
added a commit
to alphagov/finder-frontend
that referenced
this pull request
Feb 27, 2017
Full changelog: # 10.1.3 * Fix memory leak in components # 10.1.2 * Bugfix for request URI's encoded as ASCII # 10.1.1 * Bugfix for caching behaviour # 10.1.0 * Use `Rails.cache` as the cache for templates, locales and components. You can remove `config.slimmer.use_cache` for your application, as you can no longer opt-out of caching. * Add a `User-Agent` header to all outgoing API requests # 10.0.0 * Removes the need_id meta tag, which is no longer used. * Removes the functionality for breadcrumbs, related links and artefact-powered metatags. * Drop support for old Rails & Ruby versions. This gem now supports Rails 4.2 and 5.X on Ruby 2.1 and 2.2. * Renames `Slimmer::SharedTemplates` to `Slimmer::GovukComponents` # 9.6.0 * Adds an 'inside header inserter' processor which allows an application to inject a block of HTML after the logo by including a .inside-header element in their application’s output. (PR #167 alphagov/slimmer#167) * Remove `MetaViewportRemover` processor as it is no longer used. (PR #166 alphagov/slimmer#166) # 9.5.0 * Adds a Cucumber helper that makes it easy for host applications to configure Slimmer correctly under test. (PR #162 alphagov/slimmer#162) # 9.4.0 * Adds an RSpec helper that makes it easy for host applications to configure Slimmer correctly under test. Fixes `stub_shared_component_locales` helper to correctly stub HTTP requests to fetch locale information when rendering its templates. (PR #159 alphagov/slimmer#159) # 9.3.2 * Bugfix: Over time, the I18n backend would be chained in each request, causing the stack to grow too large and use too much memory (PR #157 alphagov/slimmer#157) # 9.3.1 * Allows frontend apps to stub component locales for example ```ruby class ActiveSupport::TestCase include Slimmer::TestHelpers::SharedTemplates def setup stub_shared_component_locales end end ``` (PR #155 alphagov/slimmer#155) # 9.3.0 * Integrates translations from GOVUK Components to be used in applications When including `Slimmer::SharedComponents`, the I18nBackend will be chained to `Slimmer::I18nBackend` allowing translations in `static` to work in the frontend applications (PR #152 alphagov/slimmer#152) # 9.2.1 * Replaces deprecated `before_filter` calls in shared templates. # 9.2.0 * Raise a custom `CouldNotRetrieveTemplate` exception when a connection to the assets server can't be made because of an SSL problem (PR #143). # 9.1.0 * Allow applications to request components using full or partial component paths, eg "name", "name.raw" and "name.raw.html.erb". This allows components to be nested within other components.
fofr
added a commit
to alphagov/manuals-frontend
that referenced
this pull request
Apr 6, 2017
* Fix memory leak with components: alphagov/slimmer#191 * Stub locale requests: alphagov/slimmer#159
fofr
added a commit
to alphagov/manuals-frontend
that referenced
this pull request
Apr 6, 2017
* Fix memory leak with components: alphagov/slimmer#191 * Stub locale requests: alphagov/slimmer#159
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes make the
stub_shared_component_locales
test helper more robust so that it correctly stubs requests originating from a host application.Currently Slimmer will attempt to make external HTTP requests to fetch locale information when rendering its templates.
It also adds an RSpec helper that makes it easy for host applications to configure Slimmer correctly under test.