aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/sprockets_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #8756 from causes/js_include_tag_fixGuillermo Iguaran2013-01-101-0/+7
|\ | | | | Fix javascript_include_tag when no js runtime is available
| * Fix javascript_include_tag when no js runtime is availableNoah Silas2013-01-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a production environment where the assets have been precompiled, we don't want an assets compile step to happen on the application server at all. To ensure this, a js runtime may not be available on the app servers. In this environment, pages using javascript_include_tag for assets with non-standard or chained extensions were throwing 500 errors. For instance, `javascript_include_tag('jquery.min')` would blow up. Sprockets was attempting to build the assets being included during the rewrite_extension step (responsible for appending a '.js' extension to assets being included by the basename rather than a fully qualified name). This was happening as a step to resolve #6310, which required checking for the presence of an asset with a non-standard extension before appending the extension. We can check for the presence of an asset without invoking the asset build step by using Sprockets' resolve method, which will search for the base file without building it (and is the method that find_asset uses internally to get the path to the asset before attempting to build it). When rewriting the extension on an asset, these are the steps: - If the source does not have an extension, assume that the default extension is desired and append it. - If there is an extension and it doesn't match the default extension, check to see if a file with the precise name specified exists amongst the assets; if it is present, do not append the default extension. (This is the step that resolves #6310).
* | Fixes issue where duplicate assets can be required with sprockets.jejacks0n2013-01-101-0/+5
|/ | | | | - addresses the problem by calling flatten on asset array before calling uniq. - adds note to CHANGELOG.
* Update mocha version to 0.13.0 and change requiresCarlos Antonio da Silva2012-11-131-1/+1
|
* Revert "Revert "Respect `config.digest = false` for `asset_path`""Rafael Mendonça França2012-09-201-0/+8
| | | | | | This reverts commit 54f55746a70a7091341e84236498203118a7fbb4. Reason: the last commit fixed the failing case
* Revert "Respect `config.digest = false` for `asset_path`"Rafael Mendonça França2012-09-201-8/+0
| | | | | | | | | | | | This reverts commit 1ac19c11792a745cd654f02dfaed8e93f95b3c70. Conflicts: actionpack/CHANGELOG.md Reason: This is causing failures in the railties build. See http://travis-ci.org/#!/rails/rails/jobs/2491787 Related with #7672
* Respect `config.digest = false` for `asset_path`Peter Wagenet2012-09-171-0/+8
| | | | | | | Previously, the `asset_path` internals only respected the `:digest` option, but ignored the global config setting. This meant that `config.digest = false` could not be used in conjunction with `config.compile = false` this corrects the behavior.
* Fix asset tags for files with more than one dotPiotr Sarnacki2012-06-071-0/+6
| | | | | | | | | | | | | | | After the fix done in 39f9f02a, there are cases that will not work correctly. If you have file with "2 extensions", like foo.min.js and you reference the file without extension, like: javascript_include_tag "foo.min" it will fail because sprockets finds foo.min.js with foo.min argument. This commit fixes this case and will get the right file even when referrencing it without extension. (closes #6598)
* Assets: don't add extension if other given and file existsSergey Nartimov2012-05-211-0/+3
| | | | | | | | | | | | | | We should lookup if asset without appended extension exists. When sprockets are disabled the asset tag helpers incorporate this logic. When sprockets are enabled we should have the same logic. For example, we have style.ext file in app/assets/stylesheets and we use stylesheet_link_tag in the layout. In this case we should have /assets/style.ext instead of /assets/style.ext.css in the output. Closes #6310
* Make sure that javascript_include_tag/stylesheet_link_tag methods inJorge Bejar2012-05-031-0/+6
| | | | sprockets/helpers/rails_helper.rb discard duplicated assets
* Pass extensions to javascript_path and stylesheet_path helpers. Closes #3417Santiago Pastorino2012-01-031-0/+6
|
* Add font_path helper methodSantiago Pastorino2012-01-031-0/+20
|
* Handle correctly optional parameters for callable asset_host.Marc-Andre Lafortune2011-11-291-0/+8
|
* javascript_include_tag should add '.js' to sources that contain '.'lest2011-11-221-0/+3
|
* stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't ↵Santiago Pastorino2011-10-051-0/+5
| | | | throw Sprockets::FileOutsidePaths exception anymore
* Fix the lame config.action_controller.present? check scattered throughout ↵José Valim2011-10-051-6/+9
| | | | | | | | assets_path. Conflicts: actionpack/test/template/sprockets_helper_test.rb
* Ensure default_asset_host_protocol is respected, closes #2980.José Valim2011-10-051-2/+4
|
* javascript_path and stylesheet_path should honor the asset pipeliningSantiago Pastorino2011-09-281-2/+18
|
* Correctly override image_path in sprockets rails_helperChristos Zisopoulos2011-09-261-0/+8
|
* Just assert_equal hereSantiago Pastorino2011-09-261-1/+1
|
* Merge pull request #3135 from christos/respect_assets_digest_valueSantiago Pastorino2011-09-261-0/+8
|\ | | | | Give precedence to `config.digest = false` over the existence of manifest.yml asset digests
| * Give precedence to `config.digest = false` over manifest.yml asset digestsChristos Zisopoulos2011-09-261-0/+8
| |
* | image_tag should use /assets if asset pipelining is turned on. Closes #3126Santiago Pastorino2011-09-261-0/+4
|/
* Fixes #1489 again, with updated code and numerous tests to confirmdocunext2011-09-221-0/+10
|
* Allow asset tag helper methods to accept :digest => false option in order to ↵Santiago Pastorino2011-09-141-16/+28
| | | | completely avoid the digest generation.
* Set relative url root in assets when controller isn't available for ↵Guillermo Iguaran2011-09-131-0/+7
| | | | | | Sprockets. Fix #2435 See https://github.com/rails/sass-rails/issues/42 for details
* Backport f443f9cb0c64 to masterGuillermo Iguaran2011-08-311-2/+4
|
* Merge pull request #2644 from guilleiguaran/allow-assets-debuggingSantiago Pastorino2011-08-241-0/+2
|\ | | | | Add config.allow_debugging option
| * Add config.allow_debugging option to determine if the debug_assets query ↵Guillermo Iguaran2011-08-241-0/+2
| | | | | | | | param can be passed by user
* | Debug assets shouldn't ignore media type for stylesheets. Closes #2625Guillermo Iguaran2011-08-231-0/+3
|/
* Allow to debug assets by config.assets.debugAndrey A.I. Sitnik2011-08-221-14/+6
|
* Debug assets by default in development and test environmentsGuillermo Iguaran2011-08-181-6/+22
|
* generate environment dependent asset digestsIlya Grigorik2011-08-041-0/+13
| | | | | | If two different environments are configured to use the pipeline, but one has an extra step (such as compression) then without taking the environment into account you may end up serving wrong assets
* Instead of removing the instance variable just set it to nil, resolves the ↵Brian Cardarella2011-07-291-2/+2
| | | | warnings because of a missing instance variable
* use sprocket's append_path and assert_matchDamien Mathieu2011-07-261-26/+26
|
* no need for an anonymous class on every setup callAaron Patterson2011-07-251-10/+9
|
* just use normal ruby for stubbingAaron Patterson2011-07-231-5/+3
|
* Simple fix to the NoMethodError noted in #2177.Ben Woosley2011-07-231-1/+0
| | | Unfortunately #respond_to?(:controller) won't work as suggested, nor will respond_to?(:params), as #controller is present and #params is delegated to #controller. #delegate makes respond_to? return true regardless whether the target responds to it.
* Add tests for alternate asset prefix/environmentSam Pohlenz2011-07-011-0/+12
|
* Added a configuration setting:Chris Eppstein2011-06-271-1/+18
| | | | | | | | | | | | | | | | | | | | | | config.action_controller.default_asset_host_protocol It's best to leave this unset. When unset the :request protocol is used whenever it can be and :relative is used in the other situations. When set to :request then assets hosts will be disabled when there is no request in scope and will use the request protocol whenever a request is in scope. If set to :relative, then a relative protocol is always used except for stylesheet link tags which must use the :request protocol to avoid double downloads in IE6&7. Conflicts: actionpack/lib/sprockets/helpers/rails_helper.rb actionpack/test/template/sprockets_helper_test.rb
* Add asset_url helper and refactor the asset paths so that asset hosts can be ↵Chris Eppstein2011-06-271-4/+50
| | | | | | | | | | used during asset precompilation. Conflicts: actionpack/lib/action_view/asset_paths.rb actionpack/lib/sprockets/helpers/rails_helper.rb actionpack/test/template/sprockets_helper_test.rb
* Allow multiple sources in Sprockets helpersGuillermo Iguaran2011-06-051-0/+6
|
* Fix typo in test.Andrés Botero2011-05-281-1/+1
|
* fixed asset_paths when called from sprockets for relative_url_rootjacott2011-05-281-0/+6
|
* Move the last pockets of Sprockets stuff into the Sprockets directorywycats2011-05-231-2/+1
|
* Move javascript/css helpers into the Sprockets helper and just have them ↵wycats2011-05-231-12/+12
| | | | override the old behavior
* Start moving some logic from being embedded in AV into the Rails Sprockets ↵wycats2011-05-231-0/+2
| | | | extensions
* We don't need to load version any more as Sprockets.beta8 is included. Arun Agrawal2011-05-231-7/+0
|
* Merge branch '3-1-stable'Joshua Peek2011-05-221-2/+9
|\ | | | | | | | | | | Conflicts: actionpack/actionpack.gemspec activemodel/activemodel.gemspec
| * Add debug_asset supportJoshua Peek2011-05-221-2/+9
| |