diff --git a/.travis.yml b/.travis.yml index 5214b989af39..012e795caa12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ rvm: - 2.0.0 env: - "GEM=railties" - - "GEM=ap,am,amo,as" + - "GEM=ap,am,amo,as,av" - "GEM=ar:mysql" - "GEM=ar:mysql2" - "GEM=ar:sqlite3" diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index b1c5987fe4ae..0e54b3316855 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,38 +1,5 @@ -* Use a case insensitive URI Regexp for #asset_path. +* ActionView extracted from ActionPack - This fix a problem where the same asset path using different case are generating - different URIs. - - Before: - - image_tag("HTTP://google.com") - # => "\"Google\"" - image_tag("http://google.com") - # => "\"Google\"" - - After: - - image_tag("HTTP://google.com") - # => "\"Google\"" - image_tag("http://google.com") - # => "\"Google\"" - - *David Celis* - -* Element of the `collection_check_boxes` and `collection_radio_buttons` can - optionally contain html attributes as the last element of the array. - - *Vasiliy Ermolovich* - -* Update the HTML `BOOLEAN_ATTRIBUTES` in `ActionView::Helpers::TagHelper` - to conform to the latest HTML 5.1 spec. Add attributes `allowfullscreen`, - `default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. Fix attribute - `seamless` (previously misspelled `seemless`). - - *Alex Peattie* - -* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies. - - *Bryan Ricker* + *Piotr Sarnacki*, *Łukasz Strzałkowski* Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. diff --git a/actionpack/Rakefile b/actionpack/Rakefile index 56fc92963a30..567d7b589f98 100644 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -7,14 +7,14 @@ task :default => :test # Run the unit tests desc "Run all unit tests" -task :test => [:test_action_pack, :test_active_record_integration] +task :test => [:test_action_pack] Rake::TestTask.new(:test_action_pack) do |t| t.libs << 'test' # make sure we include the tests in alphabetical order as on some systems # this will not happen automatically and the tests (as a whole) will error - t.test_files = Dir.glob('test/{abstract,controller,dispatch,template,assertions,journey}/**/*_test.rb').sort + t.test_files = Dir.glob('test/{abstract,controller,dispatch,assertions,journey}/**/*_test.rb').sort t.warning = true t.verbose = true @@ -23,25 +23,12 @@ end namespace :test do task :isolated do ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) - Dir.glob("test/{abstract,controller,dispatch,template}/**/*_test.rb").all? do |file| + Dir.glob("test/{abstract,controller,dispatch}/**/*_test.rb").all? do |file| sh(ruby, '-Ilib:test', file) end or raise "Failures" end end -namespace :test do - Rake::TestTask.new(:template) do |t| - t.libs << 'test' - t.pattern = 'test/template/**/*.rb' - end -end - -desc 'ActiveRecord Integration Tests' -Rake::TestTask.new(:test_active_record_integration) do |t| - t.libs << 'test' - t.test_files = Dir.glob("test/activerecord/*_test.rb") -end - spec = eval(File.read('actionpack.gemspec')) Gem::PackageTask.new(spec) do |p| diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec index cc8351a48957..e3aa84ba0f32 100644 --- a/actionpack/actionpack.gemspec +++ b/actionpack/actionpack.gemspec @@ -20,10 +20,10 @@ Gem::Specification.new do |s| s.requirements << 'none' s.add_dependency 'activesupport', version - s.add_dependency 'builder', '~> 3.1.0' + s.add_dependency 'actionview', version + s.add_dependency 'rack', '~> 1.5.2' s.add_dependency 'rack-test', '~> 0.6.2' - s.add_dependency 'erubis', '~> 2.7.0' s.add_development_dependency 'activemodel', version s.add_development_dependency 'tzinfo', '~> 0.3.37' diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index ca86837a2c48..e521c6ce9668 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -1,6 +1,5 @@ require 'fileutils' require 'abstract_unit' -require 'active_record_unit' CACHE_DIR = 'test_cache' # Don't change '/../temp/' cavalierly or you might hose something you don't want hosed diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md new file mode 100644 index 000000000000..135a96621d09 --- /dev/null +++ b/actionview/CHANGELOG.md @@ -0,0 +1,42 @@ +* Use a case insensitive URI Regexp for #asset_path. + + This fix a problem where the same asset path using different case are generating + different URIs. + + Before: + + image_tag("HTTP://google.com") + # => "\"Google\"" + image_tag("http://google.com") + # => "\"Google\"" + + After: + + image_tag("HTTP://google.com") + # => "\"Google\"" + image_tag("http://google.com") + # => "\"Google\"" + + *David Celis* + +* Element of the `collection_check_boxes` and `collection_radio_buttons` can + optionally contain html attributes as the last element of the array. + + *Vasiliy Ermolovich* + +* Update the HTML `BOOLEAN_ATTRIBUTES` in `ActionView::Helpers::TagHelper` + to conform to the latest HTML 5.1 spec. Add attributes `allowfullscreen`, + `default`, `inert`, `sortable`, `truespeed`, `typemustmatch`. Fix attribute + `seamless` (previously misspelled `seemless`). + + *Alex Peattie* + +* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies. + + *Bryan Ricker* + +* First release, ActionView extracted from ActionPack + + *Piotr Sarnacki*, *Łukasz Strzałkowski* + +Please check [4-0-stable (ActionPack's CHANGELOG)](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. \ No newline at end of file diff --git a/actionview/MIT-LICENSE b/actionview/MIT-LICENSE new file mode 100644 index 000000000000..810daf856c43 --- /dev/null +++ b/actionview/MIT-LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2004-2012 David Heinemeier Hansson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/actionview/README.rdoc b/actionview/README.rdoc new file mode 100644 index 000000000000..09bbfdae0b9c --- /dev/null +++ b/actionview/README.rdoc @@ -0,0 +1,31 @@ += Action View + + + +== Download and installation + +The latest version of Action View can be installed with RubyGems: + + % [sudo] gem install actionview + +Source code can be downloaded as part of the Rails project on GitHub + +* https://github.com/rails/rails/tree/master/actionview + + +== License + +Action View is released under the MIT license: + +* http://www.opensource.org/licenses/MIT + + +== Support + +API documentation is at + +* http://api.rubyonrails.org + +Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here: + +* https://github.com/rails/rails/issues diff --git a/actionview/RUNNING_UNIT_TESTS b/actionview/RUNNING_UNIT_TESTS new file mode 100644 index 000000000000..a0c35e18100c --- /dev/null +++ b/actionview/RUNNING_UNIT_TESTS @@ -0,0 +1,27 @@ +== Running with Rake + +The easiest way to run the unit tests is through Rake. The default task runs +the entire test suite for all classes. For more information, checkout the +full array of rake tasks with "rake -T" + +Rake can be found at http://rake.rubyforge.org + +== Running by hand + +To run a single test suite + + rake test TEST=path/to/test.rb + +which can be further narrowed down to one test: + + rake test TEST=path/to/test.rb TESTOPTS="--name=test_something" + +== Dependency on Active Record and database setup + +Test cases in the test/active_record/ directory depend on having +activerecord and sqlite installed. If Active Record is not in +actionview/../activerecord directory, or the sqlite rubygem is not installed, +these tests are skipped. + +Other tests are runnable from a fresh copy of actionview without any configuration. + diff --git a/actionview/Rakefile b/actionview/Rakefile new file mode 100644 index 000000000000..087b249dfeb1 --- /dev/null +++ b/actionview/Rakefile @@ -0,0 +1,79 @@ +require 'rake/testtask' +require 'rake/packagetask' +require 'rubygems/package_task' + +desc "Default Task" +task :default => :test + +# Run the unit tests + +desc "Run all unit tests" +task :test => [:test_action_view, :test_active_record_integration] + +Rake::TestTask.new(:test_action_view) do |t| + t.libs << 'test' + + # make sure we include the tests in alphabetical order as on some systems + # this will not happen automatically and the tests (as a whole) will error + t.test_files = Dir.glob('test/template/**/*_test.rb').sort + + t.warning = true + t.verbose = true +end + +namespace :test do + task :isolated do + ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) + Dir.glob("test/{active_record,template}/**/*_test.rb").all? do |file| + sh(ruby, '-Ilib:test', file) + end or raise "Failures" + end + + Rake::TestTask.new(:template) do |t| + t.libs << 'test' + t.pattern = 'test/template/**/*.rb' + end +end + +desc 'ActiveRecord Integration Tests' +Rake::TestTask.new(:test_active_record_integration) do |t| + t.libs << 'test' + t.test_files = Dir.glob("test/activerecord/*_test.rb") +end + +spec = eval(File.read('actionview.gemspec')) + +Gem::PackageTask.new(spec) do |p| + p.gem_spec = spec +end + +desc "Release to gemcutter" +task :release => :package do + require 'rake/gemcutter' + Rake::Gemcutter::Tasks.new(spec).define + Rake::Task['gem:push'].invoke +end + +task :lines do + lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 + + FileList["lib/**/*.rb"].each do |file_name| + next if file_name =~ /vendor/ + File.open(file_name, 'r') do |f| + while line = f.gets + lines += 1 + next if line =~ /^\s*$/ + next if line =~ /^\s*#/ + codelines += 1 + end + end + puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}" + + total_lines += lines + total_codelines += codelines + + lines, codelines = 0, 0 + end + + puts "Total: Lines #{total_lines}, LOC #{total_codelines}" +end diff --git a/actionview/actionview.gemspec b/actionview/actionview.gemspec new file mode 100644 index 000000000000..87cb56830063 --- /dev/null +++ b/actionview/actionview.gemspec @@ -0,0 +1,29 @@ +version = File.read(File.expand_path("../../RAILS_VERSION", __FILE__)).strip + +Gem::Specification.new do |s| + s.platform = Gem::Platform::RUBY + s.name = 'actionview' + s.version = version + s.summary = 'Rendering framework putting the V in MVC (part of Rails).' + s.description = '' + + s.required_ruby_version = '>= 1.9.3' + + s.license = 'MIT' + + s.author = 'David Heinemeier Hansson' + s.email = 'david@loudthinking.com' + s.homepage = 'http://www.rubyonrails.org' + + s.files = Dir['CHANGELOG.md', 'README.rdoc', 'MIT-LICENSE', 'lib/**/*'] + s.require_path = 'lib' + s.requirements << 'none' + + s.add_dependency 'activesupport', version + s.add_dependency 'activemodel', version + + s.add_dependency 'builder', '~> 3.1.0' + s.add_dependency 'erubis', '~> 2.7.0' + + s.add_development_dependency 'actionpack', version +end diff --git a/actionpack/lib/action_view.rb b/actionview/lib/action_view.rb similarity index 99% rename from actionpack/lib/action_view.rb rename to actionview/lib/action_view.rb index 4aafbcb65570..8def4ba7c557 100644 --- a/actionpack/lib/action_view.rb +++ b/actionview/lib/action_view.rb @@ -23,7 +23,6 @@ require 'active_support' require 'active_support/rails' -require 'action_pack' module ActionView extend ActiveSupport::Autoload diff --git a/actionpack/lib/action_view/base.rb b/actionview/lib/action_view/base.rb similarity index 100% rename from actionpack/lib/action_view/base.rb rename to actionview/lib/action_view/base.rb diff --git a/actionpack/lib/action_view/buffers.rb b/actionview/lib/action_view/buffers.rb similarity index 100% rename from actionpack/lib/action_view/buffers.rb rename to actionview/lib/action_view/buffers.rb diff --git a/actionpack/lib/action_view/context.rb b/actionview/lib/action_view/context.rb similarity index 100% rename from actionpack/lib/action_view/context.rb rename to actionview/lib/action_view/context.rb diff --git a/actionpack/lib/action_view/dependency_tracker.rb b/actionview/lib/action_view/dependency_tracker.rb similarity index 100% rename from actionpack/lib/action_view/dependency_tracker.rb rename to actionview/lib/action_view/dependency_tracker.rb diff --git a/actionpack/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb similarity index 100% rename from actionpack/lib/action_view/digestor.rb rename to actionview/lib/action_view/digestor.rb diff --git a/actionpack/lib/action_view/flows.rb b/actionview/lib/action_view/flows.rb similarity index 100% rename from actionpack/lib/action_view/flows.rb rename to actionview/lib/action_view/flows.rb diff --git a/actionpack/lib/action_view/helpers.rb b/actionview/lib/action_view/helpers.rb similarity index 100% rename from actionpack/lib/action_view/helpers.rb rename to actionview/lib/action_view/helpers.rb diff --git a/actionpack/lib/action_view/helpers/active_model_helper.rb b/actionview/lib/action_view/helpers/active_model_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/active_model_helper.rb rename to actionview/lib/action_view/helpers/active_model_helper.rb diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/asset_tag_helper.rb rename to actionview/lib/action_view/helpers/asset_tag_helper.rb diff --git a/actionpack/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/asset_url_helper.rb rename to actionview/lib/action_view/helpers/asset_url_helper.rb diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionview/lib/action_view/helpers/atom_feed_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/atom_feed_helper.rb rename to actionview/lib/action_view/helpers/atom_feed_helper.rb diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionview/lib/action_view/helpers/cache_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/cache_helper.rb rename to actionview/lib/action_view/helpers/cache_helper.rb diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/capture_helper.rb rename to actionview/lib/action_view/helpers/capture_helper.rb diff --git a/actionpack/lib/action_view/helpers/controller_helper.rb b/actionview/lib/action_view/helpers/controller_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/controller_helper.rb rename to actionview/lib/action_view/helpers/controller_helper.rb diff --git a/actionpack/lib/action_view/helpers/csrf_helper.rb b/actionview/lib/action_view/helpers/csrf_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/csrf_helper.rb rename to actionview/lib/action_view/helpers/csrf_helper.rb diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/date_helper.rb rename to actionview/lib/action_view/helpers/date_helper.rb diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionview/lib/action_view/helpers/debug_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/debug_helper.rb rename to actionview/lib/action_view/helpers/debug_helper.rb diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/form_helper.rb rename to actionview/lib/action_view/helpers/form_helper.rb diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/form_options_helper.rb rename to actionview/lib/action_view/helpers/form_options_helper.rb diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/form_tag_helper.rb rename to actionview/lib/action_view/helpers/form_tag_helper.rb diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionview/lib/action_view/helpers/javascript_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/javascript_helper.rb rename to actionview/lib/action_view/helpers/javascript_helper.rb diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionview/lib/action_view/helpers/number_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/number_helper.rb rename to actionview/lib/action_view/helpers/number_helper.rb diff --git a/actionpack/lib/action_view/helpers/output_safety_helper.rb b/actionview/lib/action_view/helpers/output_safety_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/output_safety_helper.rb rename to actionview/lib/action_view/helpers/output_safety_helper.rb diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionview/lib/action_view/helpers/record_tag_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/record_tag_helper.rb rename to actionview/lib/action_view/helpers/record_tag_helper.rb diff --git a/actionpack/lib/action_view/helpers/rendering_helper.rb b/actionview/lib/action_view/helpers/rendering_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/rendering_helper.rb rename to actionview/lib/action_view/helpers/rendering_helper.rb diff --git a/actionpack/lib/action_view/helpers/sanitize_helper.rb b/actionview/lib/action_view/helpers/sanitize_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/sanitize_helper.rb rename to actionview/lib/action_view/helpers/sanitize_helper.rb diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tag_helper.rb rename to actionview/lib/action_view/helpers/tag_helper.rb diff --git a/actionpack/lib/action_view/helpers/tags.rb b/actionview/lib/action_view/helpers/tags.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags.rb rename to actionview/lib/action_view/helpers/tags.rb diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionview/lib/action_view/helpers/tags/base.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/base.rb rename to actionview/lib/action_view/helpers/tags/base.rb diff --git a/actionpack/lib/action_view/helpers/tags/check_box.rb b/actionview/lib/action_view/helpers/tags/check_box.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/check_box.rb rename to actionview/lib/action_view/helpers/tags/check_box.rb diff --git a/actionpack/lib/action_view/helpers/tags/checkable.rb b/actionview/lib/action_view/helpers/tags/checkable.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/checkable.rb rename to actionview/lib/action_view/helpers/tags/checkable.rb diff --git a/actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb b/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb rename to actionview/lib/action_view/helpers/tags/collection_check_boxes.rb diff --git a/actionpack/lib/action_view/helpers/tags/collection_helpers.rb b/actionview/lib/action_view/helpers/tags/collection_helpers.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/collection_helpers.rb rename to actionview/lib/action_view/helpers/tags/collection_helpers.rb diff --git a/actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb b/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb rename to actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb diff --git a/actionpack/lib/action_view/helpers/tags/collection_select.rb b/actionview/lib/action_view/helpers/tags/collection_select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/collection_select.rb rename to actionview/lib/action_view/helpers/tags/collection_select.rb diff --git a/actionpack/lib/action_view/helpers/tags/color_field.rb b/actionview/lib/action_view/helpers/tags/color_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/color_field.rb rename to actionview/lib/action_view/helpers/tags/color_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/date_field.rb b/actionview/lib/action_view/helpers/tags/date_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/date_field.rb rename to actionview/lib/action_view/helpers/tags/date_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/date_select.rb b/actionview/lib/action_view/helpers/tags/date_select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/date_select.rb rename to actionview/lib/action_view/helpers/tags/date_select.rb diff --git a/actionpack/lib/action_view/helpers/tags/datetime_field.rb b/actionview/lib/action_view/helpers/tags/datetime_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/datetime_field.rb rename to actionview/lib/action_view/helpers/tags/datetime_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/datetime_local_field.rb b/actionview/lib/action_view/helpers/tags/datetime_local_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/datetime_local_field.rb rename to actionview/lib/action_view/helpers/tags/datetime_local_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/datetime_select.rb b/actionview/lib/action_view/helpers/tags/datetime_select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/datetime_select.rb rename to actionview/lib/action_view/helpers/tags/datetime_select.rb diff --git a/actionpack/lib/action_view/helpers/tags/email_field.rb b/actionview/lib/action_view/helpers/tags/email_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/email_field.rb rename to actionview/lib/action_view/helpers/tags/email_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/file_field.rb b/actionview/lib/action_view/helpers/tags/file_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/file_field.rb rename to actionview/lib/action_view/helpers/tags/file_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb b/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb rename to actionview/lib/action_view/helpers/tags/grouped_collection_select.rb diff --git a/actionpack/lib/action_view/helpers/tags/hidden_field.rb b/actionview/lib/action_view/helpers/tags/hidden_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/hidden_field.rb rename to actionview/lib/action_view/helpers/tags/hidden_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/label.rb b/actionview/lib/action_view/helpers/tags/label.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/label.rb rename to actionview/lib/action_view/helpers/tags/label.rb diff --git a/actionpack/lib/action_view/helpers/tags/month_field.rb b/actionview/lib/action_view/helpers/tags/month_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/month_field.rb rename to actionview/lib/action_view/helpers/tags/month_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/number_field.rb b/actionview/lib/action_view/helpers/tags/number_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/number_field.rb rename to actionview/lib/action_view/helpers/tags/number_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/password_field.rb b/actionview/lib/action_view/helpers/tags/password_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/password_field.rb rename to actionview/lib/action_view/helpers/tags/password_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/radio_button.rb b/actionview/lib/action_view/helpers/tags/radio_button.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/radio_button.rb rename to actionview/lib/action_view/helpers/tags/radio_button.rb diff --git a/actionpack/lib/action_view/helpers/tags/range_field.rb b/actionview/lib/action_view/helpers/tags/range_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/range_field.rb rename to actionview/lib/action_view/helpers/tags/range_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/search_field.rb b/actionview/lib/action_view/helpers/tags/search_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/search_field.rb rename to actionview/lib/action_view/helpers/tags/search_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/select.rb b/actionview/lib/action_view/helpers/tags/select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/select.rb rename to actionview/lib/action_view/helpers/tags/select.rb diff --git a/actionpack/lib/action_view/helpers/tags/tel_field.rb b/actionview/lib/action_view/helpers/tags/tel_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/tel_field.rb rename to actionview/lib/action_view/helpers/tags/tel_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/text_area.rb b/actionview/lib/action_view/helpers/tags/text_area.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/text_area.rb rename to actionview/lib/action_view/helpers/tags/text_area.rb diff --git a/actionpack/lib/action_view/helpers/tags/text_field.rb b/actionview/lib/action_view/helpers/tags/text_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/text_field.rb rename to actionview/lib/action_view/helpers/tags/text_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/time_field.rb b/actionview/lib/action_view/helpers/tags/time_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/time_field.rb rename to actionview/lib/action_view/helpers/tags/time_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/time_select.rb b/actionview/lib/action_view/helpers/tags/time_select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/time_select.rb rename to actionview/lib/action_view/helpers/tags/time_select.rb diff --git a/actionpack/lib/action_view/helpers/tags/time_zone_select.rb b/actionview/lib/action_view/helpers/tags/time_zone_select.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/time_zone_select.rb rename to actionview/lib/action_view/helpers/tags/time_zone_select.rb diff --git a/actionpack/lib/action_view/helpers/tags/url_field.rb b/actionview/lib/action_view/helpers/tags/url_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/url_field.rb rename to actionview/lib/action_view/helpers/tags/url_field.rb diff --git a/actionpack/lib/action_view/helpers/tags/week_field.rb b/actionview/lib/action_view/helpers/tags/week_field.rb similarity index 100% rename from actionpack/lib/action_view/helpers/tags/week_field.rb rename to actionview/lib/action_view/helpers/tags/week_field.rb diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/text_helper.rb rename to actionview/lib/action_view/helpers/text_helper.rb diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionview/lib/action_view/helpers/translation_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/translation_helper.rb rename to actionview/lib/action_view/helpers/translation_helper.rb diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb similarity index 100% rename from actionpack/lib/action_view/helpers/url_helper.rb rename to actionview/lib/action_view/helpers/url_helper.rb diff --git a/actionpack/lib/action_view/locale/en.yml b/actionview/lib/action_view/locale/en.yml similarity index 100% rename from actionpack/lib/action_view/locale/en.yml rename to actionview/lib/action_view/locale/en.yml diff --git a/actionpack/lib/action_view/log_subscriber.rb b/actionview/lib/action_view/log_subscriber.rb similarity index 100% rename from actionpack/lib/action_view/log_subscriber.rb rename to actionview/lib/action_view/log_subscriber.rb diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb similarity index 100% rename from actionpack/lib/action_view/lookup_context.rb rename to actionview/lib/action_view/lookup_context.rb diff --git a/actionpack/lib/action_view/model_naming.rb b/actionview/lib/action_view/model_naming.rb similarity index 100% rename from actionpack/lib/action_view/model_naming.rb rename to actionview/lib/action_view/model_naming.rb diff --git a/actionpack/lib/action_view/path_set.rb b/actionview/lib/action_view/path_set.rb similarity index 100% rename from actionpack/lib/action_view/path_set.rb rename to actionview/lib/action_view/path_set.rb diff --git a/actionpack/lib/action_view/railtie.rb b/actionview/lib/action_view/railtie.rb similarity index 100% rename from actionpack/lib/action_view/railtie.rb rename to actionview/lib/action_view/railtie.rb diff --git a/actionpack/lib/action_view/record_identifier.rb b/actionview/lib/action_view/record_identifier.rb similarity index 100% rename from actionpack/lib/action_view/record_identifier.rb rename to actionview/lib/action_view/record_identifier.rb diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionview/lib/action_view/renderer/abstract_renderer.rb similarity index 100% rename from actionpack/lib/action_view/renderer/abstract_renderer.rb rename to actionview/lib/action_view/renderer/abstract_renderer.rb diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb similarity index 100% rename from actionpack/lib/action_view/renderer/partial_renderer.rb rename to actionview/lib/action_view/renderer/partial_renderer.rb diff --git a/actionpack/lib/action_view/renderer/renderer.rb b/actionview/lib/action_view/renderer/renderer.rb similarity index 100% rename from actionpack/lib/action_view/renderer/renderer.rb rename to actionview/lib/action_view/renderer/renderer.rb diff --git a/actionpack/lib/action_view/renderer/streaming_template_renderer.rb b/actionview/lib/action_view/renderer/streaming_template_renderer.rb similarity index 100% rename from actionpack/lib/action_view/renderer/streaming_template_renderer.rb rename to actionview/lib/action_view/renderer/streaming_template_renderer.rb diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb similarity index 100% rename from actionpack/lib/action_view/renderer/template_renderer.rb rename to actionview/lib/action_view/renderer/template_renderer.rb diff --git a/actionpack/lib/action_view/routing_url_for.rb b/actionview/lib/action_view/routing_url_for.rb similarity index 100% rename from actionpack/lib/action_view/routing_url_for.rb rename to actionview/lib/action_view/routing_url_for.rb diff --git a/actionpack/lib/action_view/template.rb b/actionview/lib/action_view/template.rb similarity index 100% rename from actionpack/lib/action_view/template.rb rename to actionview/lib/action_view/template.rb diff --git a/actionpack/lib/action_view/template/error.rb b/actionview/lib/action_view/template/error.rb similarity index 100% rename from actionpack/lib/action_view/template/error.rb rename to actionview/lib/action_view/template/error.rb diff --git a/actionpack/lib/action_view/template/handlers.rb b/actionview/lib/action_view/template/handlers.rb similarity index 100% rename from actionpack/lib/action_view/template/handlers.rb rename to actionview/lib/action_view/template/handlers.rb diff --git a/actionpack/lib/action_view/template/handlers/builder.rb b/actionview/lib/action_view/template/handlers/builder.rb similarity index 100% rename from actionpack/lib/action_view/template/handlers/builder.rb rename to actionview/lib/action_view/template/handlers/builder.rb diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionview/lib/action_view/template/handlers/erb.rb similarity index 99% rename from actionpack/lib/action_view/template/handlers/erb.rb rename to actionview/lib/action_view/template/handlers/erb.rb index 7d7a7af51d6c..c8a005959644 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionview/lib/action_view/template/handlers/erb.rb @@ -1,4 +1,3 @@ -require 'action_dispatch/http/mime_type' require 'erubis' module ActionView diff --git a/actionpack/lib/action_view/template/handlers/raw.rb b/actionview/lib/action_view/template/handlers/raw.rb similarity index 100% rename from actionpack/lib/action_view/template/handlers/raw.rb rename to actionview/lib/action_view/template/handlers/raw.rb diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionview/lib/action_view/template/resolver.rb similarity index 100% rename from actionpack/lib/action_view/template/resolver.rb rename to actionview/lib/action_view/template/resolver.rb diff --git a/actionpack/lib/action_view/template/text.rb b/actionview/lib/action_view/template/text.rb similarity index 100% rename from actionpack/lib/action_view/template/text.rb rename to actionview/lib/action_view/template/text.rb diff --git a/actionpack/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb similarity index 100% rename from actionpack/lib/action_view/template/types.rb rename to actionview/lib/action_view/template/types.rb diff --git a/actionpack/lib/action_view/test_case.rb b/actionview/lib/action_view/test_case.rb similarity index 100% rename from actionpack/lib/action_view/test_case.rb rename to actionview/lib/action_view/test_case.rb diff --git a/actionpack/lib/action_view/testing/resolvers.rb b/actionview/lib/action_view/testing/resolvers.rb similarity index 100% rename from actionpack/lib/action_view/testing/resolvers.rb rename to actionview/lib/action_view/testing/resolvers.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner.rb b/actionview/lib/action_view/vendor/html-scanner.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner.rb rename to actionview/lib/action_view/vendor/html-scanner.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/document.rb b/actionview/lib/action_view/vendor/html-scanner/html/document.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner/html/document.rb rename to actionview/lib/action_view/vendor/html-scanner/html/document.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/node.rb b/actionview/lib/action_view/vendor/html-scanner/html/node.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner/html/node.rb rename to actionview/lib/action_view/vendor/html-scanner/html/node.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb b/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb rename to actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/selector.rb b/actionview/lib/action_view/vendor/html-scanner/html/selector.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner/html/selector.rb rename to actionview/lib/action_view/vendor/html-scanner/html/selector.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/tokenizer.rb b/actionview/lib/action_view/vendor/html-scanner/html/tokenizer.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner/html/tokenizer.rb rename to actionview/lib/action_view/vendor/html-scanner/html/tokenizer.rb diff --git a/actionpack/lib/action_view/vendor/html-scanner/html/version.rb b/actionview/lib/action_view/vendor/html-scanner/html/version.rb similarity index 100% rename from actionpack/lib/action_view/vendor/html-scanner/html/version.rb rename to actionview/lib/action_view/vendor/html-scanner/html/version.rb diff --git a/actionview/lib/action_view/version.rb b/actionview/lib/action_view/version.rb new file mode 100644 index 000000000000..094dd474df07 --- /dev/null +++ b/actionview/lib/action_view/version.rb @@ -0,0 +1,11 @@ +module ActionView + # Returns the version of the currently loaded ActionView as a Gem::Version + def self.version + Gem::Version.new "4.1.0.beta" + end + + module VERSION #:nodoc: + MAJOR, MINOR, TINY, PRE = ActionView.version.segments + STRING = ActionView.version.to_s + end +end diff --git a/actionview/test/abstract_unit.rb b/actionview/test/abstract_unit.rb new file mode 100644 index 000000000000..8213997f4ebc --- /dev/null +++ b/actionview/test/abstract_unit.rb @@ -0,0 +1,382 @@ +require File.expand_path('../../../load_paths', __FILE__) + +$:.unshift(File.dirname(__FILE__) + '/lib') +$:.unshift(File.dirname(__FILE__) + '/fixtures/helpers') +$:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers') + +ENV['TMPDIR'] = File.join(File.dirname(__FILE__), 'tmp') + +require 'active_support/core_ext/kernel/reporting' + +# These are the normal settings that will be set up by Railties +# TODO: Have these tests support other combinations of these values +silence_warnings do + Encoding.default_internal = "UTF-8" + Encoding.default_external = "UTF-8" +end + +require 'active_support/testing/autorun' +require 'abstract_controller' +require 'action_controller' +require 'action_view' +require 'action_view/testing/resolvers' +require 'action_dispatch' +require 'active_support/dependencies' +require 'active_model' +require 'active_record' +require 'action_controller/caching' + +require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late + +module Rails + class << self + def env + @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test") + end + end +end + +ActiveSupport::Dependencies.hook! + +Thread.abort_on_exception = true + +# Show backtraces for deprecated behavior for quicker cleanup. +ActiveSupport::Deprecation.debug = true + +# Register danish language for testing +I18n.backend.store_translations 'da', {} +I18n.backend.store_translations 'pt-BR', {} +ORIGINAL_LOCALES = I18n.available_locales.map {|locale| locale.to_s }.sort + +FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') +FIXTURES = Pathname.new(FIXTURE_LOAD_PATH) + +module RackTestUtils + def body_to_string(body) + if body.respond_to?(:each) + str = "" + body.each {|s| str << s } + str + else + body + end + end + extend self +end + +module RenderERBUtils + def view + @view ||= begin + path = ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH) + view_paths = ActionView::PathSet.new([path]) + ActionView::Base.new(view_paths) + end + end + + def render_erb(string) + @virtual_path = nil + + template = ActionView::Template.new( + string.strip, + "test template", + ActionView::Template::Handlers::ERB, + {}) + + template.render(self, {}).strip + end +end + +SharedTestRoutes = ActionDispatch::Routing::RouteSet.new + +module ActionDispatch + module SharedRoutes + def before_setup + @routes = SharedTestRoutes + super + end + end + + # Hold off drawing routes until all the possible controller classes + # have been loaded. + module DrawOnce + class << self + attr_accessor :drew + end + self.drew = false + + def before_setup + super + return if DrawOnce.drew + + SharedTestRoutes.draw do + get ':controller(/:action)' + end + + ActionDispatch::IntegrationTest.app.routes.draw do + get ':controller(/:action)' + end + + DrawOnce.drew = true + end + end +end + +module ActiveSupport + class TestCase + include ActionDispatch::DrawOnce + end +end + +class RoutedRackApp + attr_reader :routes + + def initialize(routes, &blk) + @routes = routes + @stack = ActionDispatch::MiddlewareStack.new(&blk).build(@routes) + end + + def call(env) + @stack.call(env) + end +end + +class BasicController + attr_accessor :request + + def config + @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config| + # VIEW TODO: View tests should not require a controller + public_dir = File.expand_path("../fixtures/public", __FILE__) + config.assets_dir = public_dir + config.javascripts_dir = "#{public_dir}/javascripts" + config.stylesheets_dir = "#{public_dir}/stylesheets" + config.assets = ActiveSupport::InheritableOptions.new({ :prefix => "assets" }) + config + end + end +end + +class ActionDispatch::IntegrationTest < ActiveSupport::TestCase + include ActionDispatch::SharedRoutes + + def self.build_app(routes = nil) + RoutedRackApp.new(routes || ActionDispatch::Routing::RouteSet.new) do |middleware| + middleware.use "ActionDispatch::ShowExceptions", ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public") + middleware.use "ActionDispatch::DebugExceptions" + middleware.use "ActionDispatch::Callbacks" + middleware.use "ActionDispatch::ParamsParser" + middleware.use "ActionDispatch::Cookies" + middleware.use "ActionDispatch::Flash" + middleware.use "Rack::Head" + yield(middleware) if block_given? + end + end + + self.app = build_app + + # Stub Rails dispatcher so it does not get controller references and + # simply return the controller#action as Rack::Body. + class StubDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher + protected + def controller_reference(controller_param) + controller_param + end + + def dispatch(controller, action, env) + [200, {'Content-Type' => 'text/html'}, ["#{controller}##{action}"]] + end + end + + def self.stub_controllers + old_dispatcher = ActionDispatch::Routing::RouteSet::Dispatcher + ActionDispatch::Routing::RouteSet.module_eval { remove_const :Dispatcher } + ActionDispatch::Routing::RouteSet.module_eval { const_set :Dispatcher, StubDispatcher } + yield ActionDispatch::Routing::RouteSet.new + ensure + ActionDispatch::Routing::RouteSet.module_eval { remove_const :Dispatcher } + ActionDispatch::Routing::RouteSet.module_eval { const_set :Dispatcher, old_dispatcher } + end + + def with_routing(&block) + temporary_routes = ActionDispatch::Routing::RouteSet.new + old_app, self.class.app = self.class.app, self.class.build_app(temporary_routes) + old_routes = SharedTestRoutes + silence_warnings { Object.const_set(:SharedTestRoutes, temporary_routes) } + + yield temporary_routes + ensure + self.class.app = old_app + silence_warnings { Object.const_set(:SharedTestRoutes, old_routes) } + end + + def with_autoload_path(path) + path = File.join(File.dirname(__FILE__), "fixtures", path) + if ActiveSupport::Dependencies.autoload_paths.include?(path) + yield + else + begin + ActiveSupport::Dependencies.autoload_paths << path + yield + ensure + ActiveSupport::Dependencies.autoload_paths.reject! {|p| p == path} + ActiveSupport::Dependencies.clear + end + end + end +end + +# Temporary base class +class Rack::TestCase < ActionDispatch::IntegrationTest + def self.testing(klass = nil) + if klass + @testing = "/#{klass.name.underscore}".sub!(/_controller$/, '') + else + @testing + end + end + + def get(thing, *args) + if thing.is_a?(Symbol) + super("#{self.class.testing}/#{thing}", *args) + else + super + end + end + + def assert_body(body) + assert_equal body, Array(response.body).join + end + + def assert_status(code) + assert_equal code, response.status + end + + def assert_response(body, status = 200, headers = {}) + assert_body body + assert_status status + headers.each do |header, value| + assert_header header, value + end + end + + def assert_content_type(type) + assert_equal type, response.headers["Content-Type"] + end + + def assert_header(name, value) + assert_equal value, response.headers[name] + end +end + +module ActionController + class Base + include ActionController::Testing + # This stub emulates the Railtie including the URL helpers from a Rails application + include SharedTestRoutes.url_helpers + include SharedTestRoutes.mounted_helpers + + self.view_paths = FIXTURE_LOAD_PATH + + def self.test_routes(&block) + routes = ActionDispatch::Routing::RouteSet.new + routes.draw(&block) + include routes.url_helpers + end + end + + class TestCase + include ActionDispatch::TestProcess + include ActionDispatch::SharedRoutes + end +end + +class ::ApplicationController < ActionController::Base +end + +module ActionView + class TestCase + # Must repeat the setup because AV::TestCase is a duplication + # of AC::TestCase + include ActionDispatch::SharedRoutes + end +end + +class Workshop + extend ActiveModel::Naming + include ActiveModel::Conversion + attr_accessor :id + + def initialize(id) + @id = id + end + + def persisted? + id.present? + end + + def to_s + id.to_s + end +end + +module ActionDispatch + class DebugExceptions + private + remove_method :stderr_logger + # Silence logger + def stderr_logger + nil + end + end +end + +module ActionDispatch + module RoutingVerbs + def get(uri_or_host, path = nil) + host = uri_or_host.host unless path + path ||= uri_or_host.path + + params = {'PATH_INFO' => path, + 'REQUEST_METHOD' => 'GET', + 'HTTP_HOST' => host} + + routes.call(params)[2].join + end + end +end + +module RoutingTestHelpers + def url_for(set, options, recall = nil) + set.send(:url_for, options.merge(:only_path => true, :_recall => recall)) + end +end + +class ResourcesController < ActionController::Base + def index() render :nothing => true end + alias_method :show, :index +end + +class ThreadsController < ResourcesController; end +class MessagesController < ResourcesController; end +class CommentsController < ResourcesController; end +class ReviewsController < ResourcesController; end +class AuthorsController < ResourcesController; end +class LogosController < ResourcesController; end + +class AccountsController < ResourcesController; end +class AdminController < ResourcesController; end +class ProductsController < ResourcesController; end +class ImagesController < ResourcesController; end +class PreferencesController < ResourcesController; end + +module Backoffice + class ProductsController < ResourcesController; end + class TagsController < ResourcesController; end + class ManufacturersController < ResourcesController; end + class ImagesController < ResourcesController; end + + module Admin + class ProductsController < ResourcesController; end + class ImagesController < ResourcesController; end + end +end diff --git a/actionview/test/active_record_unit.rb b/actionview/test/active_record_unit.rb new file mode 100644 index 000000000000..95fbb112c0a3 --- /dev/null +++ b/actionview/test/active_record_unit.rb @@ -0,0 +1,91 @@ +require 'abstract_unit' + +# Define the essentials +class ActiveRecordTestConnector + cattr_accessor :able_to_connect + cattr_accessor :connected + + # Set our defaults + self.connected = false + self.able_to_connect = true +end + +# Try to grab AR +unless defined?(ActiveRecord) && defined?(FixtureSet) + begin + PATH_TO_AR = "#{File.dirname(__FILE__)}/../../activerecord/lib" + raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR) + $LOAD_PATH.unshift PATH_TO_AR + require 'active_record' + rescue LoadError => e + $stderr.print "Failed to load Active Record. Skipping Active Record assertion tests: #{e}" + ActiveRecordTestConnector.able_to_connect = false + end +end +$stderr.flush + + +# Define the rest of the connector +class ActiveRecordTestConnector + class << self + def setup + unless self.connected || !self.able_to_connect + setup_connection + load_schema + require_fixture_models + self.connected = true + end + rescue Exception => e # errors from ActiveRecord setup + $stderr.puts "\nSkipping ActiveRecord assertion tests: #{e}" + #$stderr.puts " #{e.backtrace.join("\n ")}\n" + self.able_to_connect = false + end + + private + def setup_connection + if Object.const_defined?(:ActiveRecord) + defaults = { :database => ':memory:' } + adapter = defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' + options = defaults.merge :adapter => adapter, :timeout => 500 + ActiveRecord::Base.establish_connection(options) + ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options } + ActiveRecord::Base.connection + + Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE) + else + raise "Can't setup connection since ActiveRecord isn't loaded." + end + end + + # Load actionpack sqlite tables + def load_schema + File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql| + ActiveRecord::Base.connection.execute(sql) unless sql.blank? + end + end + + def require_fixture_models + Dir.glob(File.dirname(__FILE__) + "/fixtures/*.rb").each {|f| require f} + end + end +end + +class ActiveRecordTestCase < ActionController::TestCase + include ActiveRecord::TestFixtures + + # Set our fixture path + if ActiveRecordTestConnector.able_to_connect + self.fixture_path = [FIXTURE_LOAD_PATH] + self.use_transactional_fixtures = false + end + + def self.fixtures(*args) + super if ActiveRecordTestConnector.connected + end + + def run(*args) + super if ActiveRecordTestConnector.connected + end +end + +ActiveRecordTestConnector.setup diff --git a/actionpack/test/activerecord/controller_runtime_test.rb b/actionview/test/activerecord/controller_runtime_test.rb similarity index 100% rename from actionpack/test/activerecord/controller_runtime_test.rb rename to actionview/test/activerecord/controller_runtime_test.rb diff --git a/actionpack/test/activerecord/form_helper_activerecord_test.rb b/actionview/test/activerecord/form_helper_activerecord_test.rb similarity index 100% rename from actionpack/test/activerecord/form_helper_activerecord_test.rb rename to actionview/test/activerecord/form_helper_activerecord_test.rb diff --git a/actionpack/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb similarity index 100% rename from actionpack/test/activerecord/polymorphic_routes_test.rb rename to actionview/test/activerecord/polymorphic_routes_test.rb diff --git a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb b/actionview/test/activerecord/render_partial_with_record_identification_test.rb similarity index 100% rename from actionpack/test/activerecord/render_partial_with_record_identification_test.rb rename to actionview/test/activerecord/render_partial_with_record_identification_test.rb diff --git a/actionpack/test/fixtures/_top_level_partial.html.erb b/actionview/test/fixtures/_top_level_partial.html.erb similarity index 100% rename from actionpack/test/fixtures/_top_level_partial.html.erb rename to actionview/test/fixtures/_top_level_partial.html.erb diff --git a/actionview/test/fixtures/_top_level_partial_only.erb b/actionview/test/fixtures/_top_level_partial_only.erb new file mode 100644 index 000000000000..44f25b61d044 --- /dev/null +++ b/actionview/test/fixtures/_top_level_partial_only.erb @@ -0,0 +1 @@ +top level partial \ No newline at end of file diff --git a/actionpack/test/fixtures/blog_public/.gitignore b/actionview/test/fixtures/blog_public/.gitignore similarity index 100% rename from actionpack/test/fixtures/blog_public/.gitignore rename to actionview/test/fixtures/blog_public/.gitignore diff --git a/actionpack/test/fixtures/blog_public/blog.html b/actionview/test/fixtures/blog_public/blog.html similarity index 100% rename from actionpack/test/fixtures/blog_public/blog.html rename to actionview/test/fixtures/blog_public/blog.html diff --git a/actionpack/test/fixtures/blog_public/index.html b/actionview/test/fixtures/blog_public/index.html similarity index 100% rename from actionpack/test/fixtures/blog_public/index.html rename to actionview/test/fixtures/blog_public/index.html diff --git a/actionpack/test/fixtures/blog_public/subdir/index.html b/actionview/test/fixtures/blog_public/subdir/index.html similarity index 100% rename from actionpack/test/fixtures/blog_public/subdir/index.html rename to actionview/test/fixtures/blog_public/subdir/index.html diff --git a/actionpack/test/fixtures/comments/empty.de.html.erb b/actionview/test/fixtures/comments/empty.de.html.erb similarity index 100% rename from actionpack/test/fixtures/comments/empty.de.html.erb rename to actionview/test/fixtures/comments/empty.de.html.erb diff --git a/actionpack/test/fixtures/comments/empty.html.builder b/actionview/test/fixtures/comments/empty.html.builder similarity index 100% rename from actionpack/test/fixtures/comments/empty.html.builder rename to actionview/test/fixtures/comments/empty.html.builder diff --git a/actionpack/test/fixtures/comments/empty.html.erb b/actionview/test/fixtures/comments/empty.html.erb similarity index 100% rename from actionpack/test/fixtures/comments/empty.html.erb rename to actionview/test/fixtures/comments/empty.html.erb diff --git a/actionpack/test/fixtures/comments/empty.xml.erb b/actionview/test/fixtures/comments/empty.xml.erb similarity index 100% rename from actionpack/test/fixtures/comments/empty.xml.erb rename to actionview/test/fixtures/comments/empty.xml.erb diff --git a/actionpack/test/fixtures/companies.yml b/actionview/test/fixtures/companies.yml similarity index 100% rename from actionpack/test/fixtures/companies.yml rename to actionview/test/fixtures/companies.yml diff --git a/actionview/test/fixtures/company.rb b/actionview/test/fixtures/company.rb new file mode 100644 index 000000000000..f3ac3642fa52 --- /dev/null +++ b/actionview/test/fixtures/company.rb @@ -0,0 +1,9 @@ +class Company < ActiveRecord::Base + has_one :mascot + self.sequence_name = :companies_nonstd_seq + + validates_presence_of :name + def validate + errors.add('rating', 'rating should not be 2') if rating == 2 + end +end diff --git a/actionpack/test/fixtures/custom_pattern/another.html.erb b/actionview/test/fixtures/custom_pattern/another.html.erb similarity index 100% rename from actionpack/test/fixtures/custom_pattern/another.html.erb rename to actionview/test/fixtures/custom_pattern/another.html.erb diff --git a/actionpack/test/fixtures/custom_pattern/html/another.erb b/actionview/test/fixtures/custom_pattern/html/another.erb similarity index 100% rename from actionpack/test/fixtures/custom_pattern/html/another.erb rename to actionview/test/fixtures/custom_pattern/html/another.erb diff --git a/actionpack/test/fixtures/custom_pattern/html/path.erb b/actionview/test/fixtures/custom_pattern/html/path.erb similarity index 100% rename from actionpack/test/fixtures/custom_pattern/html/path.erb rename to actionview/test/fixtures/custom_pattern/html/path.erb diff --git a/actionview/test/fixtures/customers/_customer.html.erb b/actionview/test/fixtures/customers/_customer.html.erb new file mode 100644 index 000000000000..483571e22ace --- /dev/null +++ b/actionview/test/fixtures/customers/_customer.html.erb @@ -0,0 +1 @@ +<%= greeting %>: <%= customer.name %> \ No newline at end of file diff --git a/actionpack/test/fixtures/db_definitions/sqlite.sql b/actionview/test/fixtures/db_definitions/sqlite.sql similarity index 100% rename from actionpack/test/fixtures/db_definitions/sqlite.sql rename to actionview/test/fixtures/db_definitions/sqlite.sql diff --git a/actionpack/test/fixtures/developer.rb b/actionview/test/fixtures/developer.rb similarity index 100% rename from actionpack/test/fixtures/developer.rb rename to actionview/test/fixtures/developer.rb diff --git a/actionpack/test/fixtures/developers.yml b/actionview/test/fixtures/developers.yml similarity index 100% rename from actionpack/test/fixtures/developers.yml rename to actionview/test/fixtures/developers.yml diff --git a/actionpack/test/fixtures/developers/_developer.erb b/actionview/test/fixtures/developers/_developer.erb similarity index 100% rename from actionpack/test/fixtures/developers/_developer.erb rename to actionview/test/fixtures/developers/_developer.erb diff --git a/actionpack/test/fixtures/developers_projects.yml b/actionview/test/fixtures/developers_projects.yml similarity index 100% rename from actionpack/test/fixtures/developers_projects.yml rename to actionview/test/fixtures/developers_projects.yml diff --git a/actionpack/test/fixtures/digestor/comments/_comment.html.erb b/actionview/test/fixtures/digestor/comments/_comment.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/comments/_comment.html.erb rename to actionview/test/fixtures/digestor/comments/_comment.html.erb diff --git a/actionpack/test/fixtures/digestor/comments/_comments.html.erb b/actionview/test/fixtures/digestor/comments/_comments.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/comments/_comments.html.erb rename to actionview/test/fixtures/digestor/comments/_comments.html.erb diff --git a/actionpack/test/fixtures/digestor/events/_event.html.erb b/actionview/test/fixtures/digestor/events/_event.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/events/_event.html.erb rename to actionview/test/fixtures/digestor/events/_event.html.erb diff --git a/actionpack/test/fixtures/digestor/level/below/_header.html.erb b/actionview/test/fixtures/digestor/level/below/_header.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/level/below/_header.html.erb rename to actionview/test/fixtures/digestor/level/below/_header.html.erb diff --git a/actionpack/test/fixtures/digestor/level/below/index.html.erb b/actionview/test/fixtures/digestor/level/below/index.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/level/below/index.html.erb rename to actionview/test/fixtures/digestor/level/below/index.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/_form.html.erb b/actionview/test/fixtures/digestor/messages/_form.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/messages/_form.html.erb rename to actionview/test/fixtures/digestor/messages/_form.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/_header.html.erb b/actionview/test/fixtures/digestor/messages/_header.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/messages/_header.html.erb rename to actionview/test/fixtures/digestor/messages/_header.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/_message.html.erb b/actionview/test/fixtures/digestor/messages/_message.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/messages/_message.html.erb rename to actionview/test/fixtures/digestor/messages/_message.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/actions/_move.html.erb b/actionview/test/fixtures/digestor/messages/actions/_move.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/messages/actions/_move.html.erb rename to actionview/test/fixtures/digestor/messages/actions/_move.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/edit.html.erb b/actionview/test/fixtures/digestor/messages/edit.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/messages/edit.html.erb rename to actionview/test/fixtures/digestor/messages/edit.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/index.html.erb b/actionview/test/fixtures/digestor/messages/index.html.erb similarity index 100% rename from actionpack/test/fixtures/digestor/messages/index.html.erb rename to actionview/test/fixtures/digestor/messages/index.html.erb diff --git a/actionpack/test/fixtures/digestor/messages/show.html.erb b/actionview/test/fixtures/digestor/messages/show.html.erb similarity index 74% rename from actionpack/test/fixtures/digestor/messages/show.html.erb rename to actionview/test/fixtures/digestor/messages/show.html.erb index 130e67109ebf..42aa2363dd88 100644 --- a/actionpack/test/fixtures/digestor/messages/show.html.erb +++ b/actionview/test/fixtures/digestor/messages/show.html.erb @@ -6,9 +6,9 @@ <%= render @message.history.events %> -<%# render "something_missing" %> -<%# render "something_missing_1" %> +<%# render "something_missing" %> +<%# render "something_missing_1" %> <% # Template Dependency: messages/form -%> +%> \ No newline at end of file diff --git a/actionpack/test/fixtures/fun/games/_game.erb b/actionview/test/fixtures/fun/games/_game.erb similarity index 100% rename from actionpack/test/fixtures/fun/games/_game.erb rename to actionview/test/fixtures/fun/games/_game.erb diff --git a/actionview/test/fixtures/fun/games/hello_world.erb b/actionview/test/fixtures/fun/games/hello_world.erb new file mode 100644 index 000000000000..1ebfbe253935 --- /dev/null +++ b/actionview/test/fixtures/fun/games/hello_world.erb @@ -0,0 +1 @@ +Living in a nested world \ No newline at end of file diff --git a/actionpack/test/fixtures/fun/serious/games/_game.erb b/actionview/test/fixtures/fun/serious/games/_game.erb similarity index 100% rename from actionpack/test/fixtures/fun/serious/games/_game.erb rename to actionview/test/fixtures/fun/serious/games/_game.erb diff --git a/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb b/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb new file mode 100644 index 000000000000..3125583a2852 --- /dev/null +++ b/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb @@ -0,0 +1,3 @@ + +<%= cache 'nodigest', skip_digest: true do %>

ERB

<% end %> + diff --git a/actionpack/test/fixtures/games/_game.erb b/actionview/test/fixtures/games/_game.erb similarity index 100% rename from actionpack/test/fixtures/games/_game.erb rename to actionview/test/fixtures/games/_game.erb diff --git a/actionview/test/fixtures/good_customers/_good_customer.html.erb b/actionview/test/fixtures/good_customers/_good_customer.html.erb new file mode 100644 index 000000000000..a2d97ebc6d16 --- /dev/null +++ b/actionview/test/fixtures/good_customers/_good_customer.html.erb @@ -0,0 +1 @@ +<%= greeting %> good customer: <%= good_customer.name %><%= good_customer_counter %> \ No newline at end of file diff --git a/actionpack/test/fixtures/happy_path/render_action/hello_world.erb b/actionview/test/fixtures/happy_path/render_action/hello_world.erb similarity index 100% rename from actionpack/test/fixtures/happy_path/render_action/hello_world.erb rename to actionview/test/fixtures/happy_path/render_action/hello_world.erb diff --git a/actionpack/test/fixtures/layout_tests/alt/hello.erb b/actionview/test/fixtures/layout_tests/alt/hello.erb similarity index 100% rename from actionpack/test/fixtures/layout_tests/alt/hello.erb rename to actionview/test/fixtures/layout_tests/alt/hello.erb diff --git a/actionpack/test/fixtures/layouts/_column.html.erb b/actionview/test/fixtures/layouts/_column.html.erb similarity index 100% rename from actionpack/test/fixtures/layouts/_column.html.erb rename to actionview/test/fixtures/layouts/_column.html.erb diff --git a/actionview/test/fixtures/layouts/_customers.erb b/actionview/test/fixtures/layouts/_customers.erb new file mode 100644 index 000000000000..ae63f13cd355 --- /dev/null +++ b/actionview/test/fixtures/layouts/_customers.erb @@ -0,0 +1 @@ +<%= yield Struct.new(:name).new("David") %> \ No newline at end of file diff --git a/actionpack/test/fixtures/layouts/_partial_and_yield.erb b/actionview/test/fixtures/layouts/_partial_and_yield.erb similarity index 100% rename from actionpack/test/fixtures/layouts/_partial_and_yield.erb rename to actionview/test/fixtures/layouts/_partial_and_yield.erb diff --git a/actionpack/test/fixtures/layouts/_yield_only.erb b/actionview/test/fixtures/layouts/_yield_only.erb similarity index 100% rename from actionpack/test/fixtures/layouts/_yield_only.erb rename to actionview/test/fixtures/layouts/_yield_only.erb diff --git a/actionpack/test/fixtures/layouts/_yield_with_params.erb b/actionview/test/fixtures/layouts/_yield_with_params.erb similarity index 100% rename from actionpack/test/fixtures/layouts/_yield_with_params.erb rename to actionview/test/fixtures/layouts/_yield_with_params.erb diff --git a/actionpack/test/fixtures/layouts/streaming.erb b/actionview/test/fixtures/layouts/streaming.erb similarity index 100% rename from actionpack/test/fixtures/layouts/streaming.erb rename to actionview/test/fixtures/layouts/streaming.erb diff --git a/actionview/test/fixtures/layouts/yield.erb b/actionview/test/fixtures/layouts/yield.erb new file mode 100644 index 000000000000..482dc9022e5e --- /dev/null +++ b/actionview/test/fixtures/layouts/yield.erb @@ -0,0 +1,2 @@ +<%= yield :title %> +<%= yield %> diff --git a/actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb b/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb similarity index 100% rename from actionpack/test/fixtures/layouts/yield_with_render_inline_inside.erb rename to actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb diff --git a/actionpack/test/fixtures/layouts/yield_with_render_partial_inside.erb b/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb similarity index 100% rename from actionpack/test/fixtures/layouts/yield_with_render_partial_inside.erb rename to actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb diff --git a/actionpack/test/fixtures/mascot.rb b/actionview/test/fixtures/mascot.rb similarity index 100% rename from actionpack/test/fixtures/mascot.rb rename to actionview/test/fixtures/mascot.rb diff --git a/actionpack/test/fixtures/mascots.yml b/actionview/test/fixtures/mascots.yml similarity index 100% rename from actionpack/test/fixtures/mascots.yml rename to actionview/test/fixtures/mascots.yml diff --git a/actionpack/test/fixtures/mascots/_mascot.html.erb b/actionview/test/fixtures/mascots/_mascot.html.erb similarity index 100% rename from actionpack/test/fixtures/mascots/_mascot.html.erb rename to actionview/test/fixtures/mascots/_mascot.html.erb diff --git a/actionview/test/fixtures/multipart/bracketed_utf8_param b/actionview/test/fixtures/multipart/bracketed_utf8_param new file mode 100644 index 000000000000..df9cecea0834 --- /dev/null +++ b/actionview/test/fixtures/multipart/bracketed_utf8_param @@ -0,0 +1,5 @@ +--AaB03x +Content-Disposition: form-data; name="Iñtërnâtiônàlizætiøn_name[Iñtërnâtiônàlizætiøn_nested_name]" + +Iñtërnâtiônàlizætiøn_value +--AaB03x-- diff --git a/actionview/test/fixtures/multipart/single_utf8_param b/actionview/test/fixtures/multipart/single_utf8_param new file mode 100644 index 000000000000..1d9fae7b17f2 --- /dev/null +++ b/actionview/test/fixtures/multipart/single_utf8_param @@ -0,0 +1,5 @@ +--AaB03x +Content-Disposition: form-data; name="Iñtërnâtiônàlizætiøn_name" + +Iñtërnâtiônàlizætiøn_value +--AaB03x-- diff --git a/actionpack/test/fixtures/plain_text.raw b/actionview/test/fixtures/plain_text.raw similarity index 100% rename from actionpack/test/fixtures/plain_text.raw rename to actionview/test/fixtures/plain_text.raw diff --git a/actionpack/test/fixtures/plain_text_with_characters.raw b/actionview/test/fixtures/plain_text_with_characters.raw similarity index 100% rename from actionpack/test/fixtures/plain_text_with_characters.raw rename to actionview/test/fixtures/plain_text_with_characters.raw diff --git a/actionpack/test/fixtures/project.rb b/actionview/test/fixtures/project.rb similarity index 100% rename from actionpack/test/fixtures/project.rb rename to actionview/test/fixtures/project.rb diff --git a/actionpack/test/fixtures/projects.yml b/actionview/test/fixtures/projects.yml similarity index 100% rename from actionpack/test/fixtures/projects.yml rename to actionview/test/fixtures/projects.yml diff --git a/actionpack/test/fixtures/projects/_project.erb b/actionview/test/fixtures/projects/_project.erb similarity index 100% rename from actionpack/test/fixtures/projects/_project.erb rename to actionview/test/fixtures/projects/_project.erb diff --git a/actionpack/test/fixtures/public/.gitignore b/actionview/test/fixtures/public/.gitignore similarity index 100% rename from actionpack/test/fixtures/public/.gitignore rename to actionview/test/fixtures/public/.gitignore diff --git a/actionpack/test/fixtures/public/elsewhere/cools.js b/actionview/test/fixtures/public/elsewhere/cools.js similarity index 100% rename from actionpack/test/fixtures/public/elsewhere/cools.js rename to actionview/test/fixtures/public/elsewhere/cools.js diff --git a/actionpack/test/fixtures/public/elsewhere/file.css b/actionview/test/fixtures/public/elsewhere/file.css similarity index 100% rename from actionpack/test/fixtures/public/elsewhere/file.css rename to actionview/test/fixtures/public/elsewhere/file.css diff --git a/actionview/test/fixtures/public/foo/baz.css b/actionview/test/fixtures/public/foo/baz.css new file mode 100644 index 000000000000..b5173fbef277 --- /dev/null +++ b/actionview/test/fixtures/public/foo/baz.css @@ -0,0 +1,3 @@ +body { +background: #000; +} diff --git a/actionpack/test/fixtures/public/javascripts/application.js b/actionview/test/fixtures/public/javascripts/application.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/application.js rename to actionview/test/fixtures/public/javascripts/application.js diff --git a/actionpack/test/fixtures/public/javascripts/bank.js b/actionview/test/fixtures/public/javascripts/bank.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/bank.js rename to actionview/test/fixtures/public/javascripts/bank.js diff --git a/actionpack/test/fixtures/public/javascripts/common.javascript b/actionview/test/fixtures/public/javascripts/common.javascript similarity index 100% rename from actionpack/test/fixtures/public/javascripts/common.javascript rename to actionview/test/fixtures/public/javascripts/common.javascript diff --git a/actionpack/test/fixtures/public/javascripts/controls.js b/actionview/test/fixtures/public/javascripts/controls.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/controls.js rename to actionview/test/fixtures/public/javascripts/controls.js diff --git a/actionpack/test/fixtures/public/javascripts/dragdrop.js b/actionview/test/fixtures/public/javascripts/dragdrop.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/dragdrop.js rename to actionview/test/fixtures/public/javascripts/dragdrop.js diff --git a/actionpack/test/fixtures/public/javascripts/effects.js b/actionview/test/fixtures/public/javascripts/effects.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/effects.js rename to actionview/test/fixtures/public/javascripts/effects.js diff --git a/actionpack/test/fixtures/public/javascripts/prototype.js b/actionview/test/fixtures/public/javascripts/prototype.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/prototype.js rename to actionview/test/fixtures/public/javascripts/prototype.js diff --git a/actionpack/test/fixtures/public/javascripts/robber.js b/actionview/test/fixtures/public/javascripts/robber.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/robber.js rename to actionview/test/fixtures/public/javascripts/robber.js diff --git a/actionpack/test/fixtures/public/javascripts/subdir/subdir.js b/actionview/test/fixtures/public/javascripts/subdir/subdir.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/subdir/subdir.js rename to actionview/test/fixtures/public/javascripts/subdir/subdir.js diff --git a/actionpack/test/fixtures/public/javascripts/version.1.0.js b/actionview/test/fixtures/public/javascripts/version.1.0.js similarity index 100% rename from actionpack/test/fixtures/public/javascripts/version.1.0.js rename to actionview/test/fixtures/public/javascripts/version.1.0.js diff --git a/actionpack/test/fixtures/public/stylesheets/bank.css b/actionview/test/fixtures/public/stylesheets/bank.css similarity index 100% rename from actionpack/test/fixtures/public/stylesheets/bank.css rename to actionview/test/fixtures/public/stylesheets/bank.css diff --git a/actionpack/test/fixtures/public/stylesheets/random.styles b/actionview/test/fixtures/public/stylesheets/random.styles similarity index 100% rename from actionpack/test/fixtures/public/stylesheets/random.styles rename to actionview/test/fixtures/public/stylesheets/random.styles diff --git a/actionpack/test/fixtures/public/stylesheets/robber.css b/actionview/test/fixtures/public/stylesheets/robber.css similarity index 100% rename from actionpack/test/fixtures/public/stylesheets/robber.css rename to actionview/test/fixtures/public/stylesheets/robber.css diff --git a/actionpack/test/fixtures/public/stylesheets/subdir/subdir.css b/actionview/test/fixtures/public/stylesheets/subdir/subdir.css similarity index 100% rename from actionpack/test/fixtures/public/stylesheets/subdir/subdir.css rename to actionview/test/fixtures/public/stylesheets/subdir/subdir.css diff --git a/actionpack/test/fixtures/public/stylesheets/version.1.0.css b/actionview/test/fixtures/public/stylesheets/version.1.0.css similarity index 100% rename from actionpack/test/fixtures/public/stylesheets/version.1.0.css rename to actionview/test/fixtures/public/stylesheets/version.1.0.css diff --git a/actionpack/test/fixtures/replies.yml b/actionview/test/fixtures/replies.yml similarity index 100% rename from actionpack/test/fixtures/replies.yml rename to actionview/test/fixtures/replies.yml diff --git a/actionpack/test/fixtures/replies/_reply.erb b/actionview/test/fixtures/replies/_reply.erb similarity index 100% rename from actionpack/test/fixtures/replies/_reply.erb rename to actionview/test/fixtures/replies/_reply.erb diff --git a/actionpack/test/fixtures/reply.rb b/actionview/test/fixtures/reply.rb similarity index 100% rename from actionpack/test/fixtures/reply.rb rename to actionview/test/fixtures/reply.rb diff --git a/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb b/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb new file mode 100644 index 000000000000..9f1f85526942 --- /dev/null +++ b/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb @@ -0,0 +1 @@ +HTML! diff --git a/actionview/test/fixtures/ruby_template.ruby b/actionview/test/fixtures/ruby_template.ruby new file mode 100644 index 000000000000..5097bce47c09 --- /dev/null +++ b/actionview/test/fixtures/ruby_template.ruby @@ -0,0 +1,2 @@ +body = "" +body << ["Hello", "from", "Ruby", "code"].join(" ") diff --git a/actionpack/test/fixtures/scope/test/modgreet.erb b/actionview/test/fixtures/scope/test/modgreet.erb similarity index 100% rename from actionpack/test/fixtures/scope/test/modgreet.erb rename to actionview/test/fixtures/scope/test/modgreet.erb diff --git a/actionview/test/fixtures/shared.html.erb b/actionview/test/fixtures/shared.html.erb new file mode 100644 index 000000000000..af262fc9f897 --- /dev/null +++ b/actionview/test/fixtures/shared.html.erb @@ -0,0 +1 @@ +Elastica \ No newline at end of file diff --git a/actionpack/test/fixtures/test/_200.html.erb b/actionview/test/fixtures/test/_200.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_200.html.erb rename to actionview/test/fixtures/test/_200.html.erb diff --git a/actionpack/test/fixtures/test/_b_layout_for_partial.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_b_layout_for_partial.html.erb rename to actionview/test/fixtures/test/_b_layout_for_partial.html.erb diff --git a/actionpack/test/fixtures/test/_b_layout_for_partial_with_object.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_b_layout_for_partial_with_object.html.erb rename to actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb diff --git a/actionpack/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb rename to actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb diff --git a/actionview/test/fixtures/test/_changing_priority.html.erb b/actionview/test/fixtures/test/_changing_priority.html.erb new file mode 100644 index 000000000000..3225efc49a9a --- /dev/null +++ b/actionview/test/fixtures/test/_changing_priority.html.erb @@ -0,0 +1 @@ +HTML \ No newline at end of file diff --git a/actionview/test/fixtures/test/_changing_priority.json.erb b/actionview/test/fixtures/test/_changing_priority.json.erb new file mode 100644 index 000000000000..7fa41dce6685 --- /dev/null +++ b/actionview/test/fixtures/test/_changing_priority.json.erb @@ -0,0 +1 @@ +JSON \ No newline at end of file diff --git a/actionpack/test/fixtures/test/_content_tag_nested_in_content_tag.erb b/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb similarity index 100% rename from actionpack/test/fixtures/test/_content_tag_nested_in_content_tag.erb rename to actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb diff --git a/actionview/test/fixtures/test/_counter.html.erb b/actionview/test/fixtures/test/_counter.html.erb new file mode 100644 index 000000000000..fd245bfc7018 --- /dev/null +++ b/actionview/test/fixtures/test/_counter.html.erb @@ -0,0 +1 @@ +<%= counter_counter %> \ No newline at end of file diff --git a/actionview/test/fixtures/test/_customer.erb b/actionview/test/fixtures/test/_customer.erb new file mode 100644 index 000000000000..d8220afeda5a --- /dev/null +++ b/actionview/test/fixtures/test/_customer.erb @@ -0,0 +1 @@ +Hello: <%= customer.name rescue "Anonymous" %> \ No newline at end of file diff --git a/actionview/test/fixtures/test/_customer_greeting.erb b/actionview/test/fixtures/test/_customer_greeting.erb new file mode 100644 index 000000000000..6acbcb20c4e5 --- /dev/null +++ b/actionview/test/fixtures/test/_customer_greeting.erb @@ -0,0 +1 @@ +<%= greeting %>: <%= customer_greeting.name %> \ No newline at end of file diff --git a/actionview/test/fixtures/test/_customer_with_var.erb b/actionview/test/fixtures/test/_customer_with_var.erb new file mode 100644 index 000000000000..00047dd20e8b --- /dev/null +++ b/actionview/test/fixtures/test/_customer_with_var.erb @@ -0,0 +1 @@ +<%= customer.name %> <%= customer.name %> <%= customer.name %> \ No newline at end of file diff --git a/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb b/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb new file mode 100644 index 000000000000..1cc8d41475fe --- /dev/null +++ b/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb @@ -0,0 +1 @@ +Hello <%= name %> diff --git a/actionview/test/fixtures/test/_first_json_partial.json.erb b/actionview/test/fixtures/test/_first_json_partial.json.erb new file mode 100644 index 000000000000..790ee896dbeb --- /dev/null +++ b/actionview/test/fixtures/test/_first_json_partial.json.erb @@ -0,0 +1 @@ +<%= render :partial => "test/second_json_partial" %> \ No newline at end of file diff --git a/actionpack/test/fixtures/test/_from_helper.erb b/actionview/test/fixtures/test/_from_helper.erb similarity index 100% rename from actionpack/test/fixtures/test/_from_helper.erb rename to actionview/test/fixtures/test/_from_helper.erb diff --git a/actionview/test/fixtures/test/_json_change_priority.json.erb b/actionview/test/fixtures/test/_json_change_priority.json.erb new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/actionpack/test/fixtures/test/_label_with_block.erb b/actionview/test/fixtures/test/_label_with_block.erb similarity index 100% rename from actionpack/test/fixtures/test/_label_with_block.erb rename to actionview/test/fixtures/test/_label_with_block.erb diff --git a/actionpack/test/fixtures/test/_layout_for_block_with_args.html.erb b/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_layout_for_block_with_args.html.erb rename to actionview/test/fixtures/test/_layout_for_block_with_args.html.erb diff --git a/actionview/test/fixtures/test/_layout_for_partial.html.erb b/actionview/test/fixtures/test/_layout_for_partial.html.erb new file mode 100644 index 000000000000..666efadbb62d --- /dev/null +++ b/actionview/test/fixtures/test/_layout_for_partial.html.erb @@ -0,0 +1,3 @@ +Before (<%= name %>) +<%= yield %> +After \ No newline at end of file diff --git a/actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb b/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb rename to actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb diff --git a/actionpack/test/fixtures/test/_local_inspector.html.erb b/actionview/test/fixtures/test/_local_inspector.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_local_inspector.html.erb rename to actionview/test/fixtures/test/_local_inspector.html.erb diff --git a/actionpack/test/fixtures/test/_object_inspector.erb b/actionview/test/fixtures/test/_object_inspector.erb similarity index 100% rename from actionpack/test/fixtures/test/_object_inspector.erb rename to actionview/test/fixtures/test/_object_inspector.erb diff --git a/actionpack/test/fixtures/test/_one.html.erb b/actionview/test/fixtures/test/_one.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_one.html.erb rename to actionview/test/fixtures/test/_one.html.erb diff --git a/actionview/test/fixtures/test/_partial.erb b/actionview/test/fixtures/test/_partial.erb new file mode 100644 index 000000000000..e466dcbd8e8f --- /dev/null +++ b/actionview/test/fixtures/test/_partial.erb @@ -0,0 +1 @@ +invalid \ No newline at end of file diff --git a/actionview/test/fixtures/test/_partial.html.erb b/actionview/test/fixtures/test/_partial.html.erb new file mode 100644 index 000000000000..e39f6c982770 --- /dev/null +++ b/actionview/test/fixtures/test/_partial.html.erb @@ -0,0 +1 @@ +partial html \ No newline at end of file diff --git a/actionview/test/fixtures/test/_partial.js.erb b/actionview/test/fixtures/test/_partial.js.erb new file mode 100644 index 000000000000..b350cdd7efb3 --- /dev/null +++ b/actionview/test/fixtures/test/_partial.js.erb @@ -0,0 +1 @@ +partial js \ No newline at end of file diff --git a/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb b/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb new file mode 100644 index 000000000000..3a03a64e3195 --- /dev/null +++ b/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb @@ -0,0 +1 @@ +Inside from partial (<%= name %>) \ No newline at end of file diff --git a/actionview/test/fixtures/test/_partial_name_local_variable.erb b/actionview/test/fixtures/test/_partial_name_local_variable.erb new file mode 100644 index 000000000000..cc3a91c89fc9 --- /dev/null +++ b/actionview/test/fixtures/test/_partial_name_local_variable.erb @@ -0,0 +1 @@ +<%= partial_name_local_variable %> diff --git a/actionview/test/fixtures/test/_partial_only.erb b/actionview/test/fixtures/test/_partial_only.erb new file mode 100644 index 000000000000..a44b3eed4059 --- /dev/null +++ b/actionview/test/fixtures/test/_partial_only.erb @@ -0,0 +1 @@ +only partial \ No newline at end of file diff --git a/actionpack/test/fixtures/test/_partial_with_layout.erb b/actionview/test/fixtures/test/_partial_with_layout.erb similarity index 100% rename from actionpack/test/fixtures/test/_partial_with_layout.erb rename to actionview/test/fixtures/test/_partial_with_layout.erb diff --git a/actionpack/test/fixtures/test/_partial_with_layout_block_content.erb b/actionview/test/fixtures/test/_partial_with_layout_block_content.erb similarity index 100% rename from actionpack/test/fixtures/test/_partial_with_layout_block_content.erb rename to actionview/test/fixtures/test/_partial_with_layout_block_content.erb diff --git a/actionpack/test/fixtures/test/_partial_with_layout_block_partial.erb b/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb similarity index 100% rename from actionpack/test/fixtures/test/_partial_with_layout_block_partial.erb rename to actionview/test/fixtures/test/_partial_with_layout_block_partial.erb diff --git a/actionpack/test/fixtures/test/_partial_with_only_html_version.html.erb b/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_partial_with_only_html_version.html.erb rename to actionview/test/fixtures/test/_partial_with_only_html_version.html.erb diff --git a/actionview/test/fixtures/test/_partial_with_partial.erb b/actionview/test/fixtures/test/_partial_with_partial.erb new file mode 100644 index 000000000000..ee0d5037b674 --- /dev/null +++ b/actionview/test/fixtures/test/_partial_with_partial.erb @@ -0,0 +1,2 @@ +<%= render 'test/partial' %> +partial with partial diff --git a/actionpack/test/fixtures/test/_raise.html.erb b/actionview/test/fixtures/test/_raise.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_raise.html.erb rename to actionview/test/fixtures/test/_raise.html.erb diff --git a/actionview/test/fixtures/test/_raise_indentation.html.erb b/actionview/test/fixtures/test/_raise_indentation.html.erb new file mode 100644 index 000000000000..f9a93728feb6 --- /dev/null +++ b/actionview/test/fixtures/test/_raise_indentation.html.erb @@ -0,0 +1,13 @@ +

First paragraph

+

Second paragraph

+

Third paragraph

+

Fourth paragraph

+

Fifth paragraph

+

Sixth paragraph

+

Seventh paragraph

+

Eight paragraph

+

Ninth paragraph

+

Tenth paragraph

+<%= raise "error here!" %> +

Eleventh paragraph

+

Twelfth paragraph

\ No newline at end of file diff --git a/actionview/test/fixtures/test/_second_json_partial.json.erb b/actionview/test/fixtures/test/_second_json_partial.json.erb new file mode 100644 index 000000000000..5ebb7f1afde1 --- /dev/null +++ b/actionview/test/fixtures/test/_second_json_partial.json.erb @@ -0,0 +1 @@ +Third level \ No newline at end of file diff --git a/actionpack/test/fixtures/test/_two.html.erb b/actionview/test/fixtures/test/_two.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_two.html.erb rename to actionview/test/fixtures/test/_two.html.erb diff --git a/actionpack/test/fixtures/test/_utf8_partial.html.erb b/actionview/test/fixtures/test/_utf8_partial.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_utf8_partial.html.erb rename to actionview/test/fixtures/test/_utf8_partial.html.erb diff --git a/actionpack/test/fixtures/test/_utf8_partial_magic.html.erb b/actionview/test/fixtures/test/_utf8_partial_magic.html.erb similarity index 100% rename from actionpack/test/fixtures/test/_utf8_partial_magic.html.erb rename to actionview/test/fixtures/test/_utf8_partial_magic.html.erb diff --git a/actionpack/test/fixtures/test/basic.html.erb b/actionview/test/fixtures/test/basic.html.erb similarity index 100% rename from actionpack/test/fixtures/test/basic.html.erb rename to actionview/test/fixtures/test/basic.html.erb diff --git a/actionview/test/fixtures/test/calling_partial_with_layout.html.erb b/actionview/test/fixtures/test/calling_partial_with_layout.html.erb new file mode 100644 index 000000000000..ac44bc0d81fb --- /dev/null +++ b/actionview/test/fixtures/test/calling_partial_with_layout.html.erb @@ -0,0 +1 @@ +<%= render(:layout => "layout_for_partial", :partial => "partial_for_use_in_layout", :locals => { :name => "David" }) %> \ No newline at end of file diff --git a/actionview/test/fixtures/test/change_priority.html.erb b/actionview/test/fixtures/test/change_priority.html.erb new file mode 100644 index 000000000000..5618977d057b --- /dev/null +++ b/actionview/test/fixtures/test/change_priority.html.erb @@ -0,0 +1,2 @@ +<%= render :partial => "test/json_change_priority", formats: :json %> +HTML Template, but <%= render :partial => "test/changing_priority" %> partial \ No newline at end of file diff --git a/actionpack/test/fixtures/test/dont_pick_me b/actionview/test/fixtures/test/dont_pick_me similarity index 100% rename from actionpack/test/fixtures/test/dont_pick_me rename to actionview/test/fixtures/test/dont_pick_me diff --git a/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb b/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb new file mode 100644 index 000000000000..8b8a44923665 --- /dev/null +++ b/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb @@ -0,0 +1 @@ +The secret is <%= @secret %> diff --git a/actionview/test/fixtures/test/greeting.xml.erb b/actionview/test/fixtures/test/greeting.xml.erb new file mode 100644 index 000000000000..62fb0293f0dd --- /dev/null +++ b/actionview/test/fixtures/test/greeting.xml.erb @@ -0,0 +1 @@ +

This is grand!

diff --git a/actionview/test/fixtures/test/hello.builder b/actionview/test/fixtures/test/hello.builder new file mode 100644 index 000000000000..a471553941ed --- /dev/null +++ b/actionview/test/fixtures/test/hello.builder @@ -0,0 +1,4 @@ +xml.html do + xml.p "Hello #{@name}" + xml << render(:file => "test/greeting") +end \ No newline at end of file diff --git a/actionview/test/fixtures/test/hello/hello.erb b/actionview/test/fixtures/test/hello/hello.erb new file mode 100644 index 000000000000..6769dd60bdf5 --- /dev/null +++ b/actionview/test/fixtures/test/hello/hello.erb @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/actionpack/test/fixtures/test/hello_world.da.html.erb b/actionview/test/fixtures/test/hello_world.da.html.erb similarity index 100% rename from actionpack/test/fixtures/test/hello_world.da.html.erb rename to actionview/test/fixtures/test/hello_world.da.html.erb diff --git a/actionview/test/fixtures/test/hello_world.erb b/actionview/test/fixtures/test/hello_world.erb new file mode 100644 index 000000000000..6769dd60bdf5 --- /dev/null +++ b/actionview/test/fixtures/test/hello_world.erb @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/actionpack/test/fixtures/test/hello_world.erb~ b/actionview/test/fixtures/test/hello_world.erb~ similarity index 100% rename from actionpack/test/fixtures/test/hello_world.erb~ rename to actionview/test/fixtures/test/hello_world.erb~ diff --git a/actionpack/test/fixtures/test/hello_world.pt-BR.html.erb b/actionview/test/fixtures/test/hello_world.pt-BR.html.erb similarity index 100% rename from actionpack/test/fixtures/test/hello_world.pt-BR.html.erb rename to actionview/test/fixtures/test/hello_world.pt-BR.html.erb diff --git a/actionview/test/fixtures/test/hello_world_with_partial.html.erb b/actionview/test/fixtures/test/hello_world_with_partial.html.erb new file mode 100644 index 000000000000..ec3154535631 --- /dev/null +++ b/actionview/test/fixtures/test/hello_world_with_partial.html.erb @@ -0,0 +1,2 @@ +Hello world! +<%= render '/test/partial' %> diff --git a/actionview/test/fixtures/test/html_template.html.erb b/actionview/test/fixtures/test/html_template.html.erb new file mode 100644 index 000000000000..1bbc2b7f09bf --- /dev/null +++ b/actionview/test/fixtures/test/html_template.html.erb @@ -0,0 +1 @@ +<%= render :partial => "test/first_json_partial", formats: :json %> \ No newline at end of file diff --git a/actionpack/test/fixtures/test/layout_render_file.erb b/actionview/test/fixtures/test/layout_render_file.erb similarity index 100% rename from actionpack/test/fixtures/test/layout_render_file.erb rename to actionview/test/fixtures/test/layout_render_file.erb diff --git a/actionpack/test/fixtures/test/layout_render_object.erb b/actionview/test/fixtures/test/layout_render_object.erb similarity index 100% rename from actionpack/test/fixtures/test/layout_render_object.erb rename to actionview/test/fixtures/test/layout_render_object.erb diff --git a/actionview/test/fixtures/test/list.erb b/actionview/test/fixtures/test/list.erb new file mode 100644 index 000000000000..0a4bda58ee2c --- /dev/null +++ b/actionview/test/fixtures/test/list.erb @@ -0,0 +1 @@ +<%= @test_unchanged = 'goodbye' %><%= render :partial => 'customer', :collection => @customers %><%= @test_unchanged %> diff --git a/actionpack/test/fixtures/test/malformed/malformed.en.html.erb~ b/actionview/test/fixtures/test/malformed/malformed.en.html.erb~ similarity index 100% rename from actionpack/test/fixtures/test/malformed/malformed.en.html.erb~ rename to actionview/test/fixtures/test/malformed/malformed.en.html.erb~ diff --git a/actionpack/test/fixtures/test/malformed/malformed.erb~ b/actionview/test/fixtures/test/malformed/malformed.erb~ similarity index 100% rename from actionpack/test/fixtures/test/malformed/malformed.erb~ rename to actionview/test/fixtures/test/malformed/malformed.erb~ diff --git a/actionpack/test/fixtures/test/malformed/malformed.html.erb~ b/actionview/test/fixtures/test/malformed/malformed.html.erb~ similarity index 100% rename from actionpack/test/fixtures/test/malformed/malformed.html.erb~ rename to actionview/test/fixtures/test/malformed/malformed.html.erb~ diff --git a/actionview/test/fixtures/test/malformed/malformed~ b/actionview/test/fixtures/test/malformed/malformed~ new file mode 100644 index 000000000000..d00995038440 --- /dev/null +++ b/actionview/test/fixtures/test/malformed/malformed~ @@ -0,0 +1 @@ +Don't render me! \ No newline at end of file diff --git a/actionpack/test/fixtures/test/nested_layout.erb b/actionview/test/fixtures/test/nested_layout.erb similarity index 100% rename from actionpack/test/fixtures/test/nested_layout.erb rename to actionview/test/fixtures/test/nested_layout.erb diff --git a/actionpack/test/fixtures/test/nested_streaming.erb b/actionview/test/fixtures/test/nested_streaming.erb similarity index 100% rename from actionpack/test/fixtures/test/nested_streaming.erb rename to actionview/test/fixtures/test/nested_streaming.erb diff --git a/actionpack/test/fixtures/test/one.html.erb b/actionview/test/fixtures/test/one.html.erb similarity index 100% rename from actionpack/test/fixtures/test/one.html.erb rename to actionview/test/fixtures/test/one.html.erb diff --git a/actionview/test/fixtures/test/render_file_with_ivar.erb b/actionview/test/fixtures/test/render_file_with_ivar.erb new file mode 100644 index 000000000000..8b8a44923665 --- /dev/null +++ b/actionview/test/fixtures/test/render_file_with_ivar.erb @@ -0,0 +1 @@ +The secret is <%= @secret %> diff --git a/actionview/test/fixtures/test/render_file_with_locals.erb b/actionview/test/fixtures/test/render_file_with_locals.erb new file mode 100644 index 000000000000..ebe09faee616 --- /dev/null +++ b/actionview/test/fixtures/test/render_file_with_locals.erb @@ -0,0 +1 @@ +The secret is <%= secret %> diff --git a/actionview/test/fixtures/test/render_file_with_locals_and_default.erb b/actionview/test/fixtures/test/render_file_with_locals_and_default.erb new file mode 100644 index 000000000000..9b4900acc56b --- /dev/null +++ b/actionview/test/fixtures/test/render_file_with_locals_and_default.erb @@ -0,0 +1 @@ +<%= secret ||= 'one' %> \ No newline at end of file diff --git a/actionview/test/fixtures/test/render_partial_inside_directory.html.erb b/actionview/test/fixtures/test/render_partial_inside_directory.html.erb new file mode 100644 index 000000000000..1461b9518638 --- /dev/null +++ b/actionview/test/fixtures/test/render_partial_inside_directory.html.erb @@ -0,0 +1 @@ +<%= render partial: 'test/_directory/partial_with_locales', locals: {'name' => 'Jane'} %> diff --git a/actionview/test/fixtures/test/render_two_partials.html.erb b/actionview/test/fixtures/test/render_two_partials.html.erb new file mode 100644 index 000000000000..3db6025860a2 --- /dev/null +++ b/actionview/test/fixtures/test/render_two_partials.html.erb @@ -0,0 +1,2 @@ +<%= render :partial => 'partial', :locals => {'first' => '1'} %> +<%= render :partial => 'partial', :locals => {'second' => '2'} %> diff --git a/actionpack/test/fixtures/test/streaming.erb b/actionview/test/fixtures/test/streaming.erb similarity index 100% rename from actionpack/test/fixtures/test/streaming.erb rename to actionview/test/fixtures/test/streaming.erb diff --git a/actionpack/test/fixtures/test/streaming_buster.erb b/actionview/test/fixtures/test/streaming_buster.erb similarity index 100% rename from actionpack/test/fixtures/test/streaming_buster.erb rename to actionview/test/fixtures/test/streaming_buster.erb diff --git a/actionpack/test/fixtures/test/sub_template_raise.html.erb b/actionview/test/fixtures/test/sub_template_raise.html.erb similarity index 100% rename from actionpack/test/fixtures/test/sub_template_raise.html.erb rename to actionview/test/fixtures/test/sub_template_raise.html.erb diff --git a/actionpack/test/fixtures/test/template.erb b/actionview/test/fixtures/test/template.erb similarity index 100% rename from actionpack/test/fixtures/test/template.erb rename to actionview/test/fixtures/test/template.erb diff --git a/actionpack/test/fixtures/test/update_element_with_capture.erb b/actionview/test/fixtures/test/update_element_with_capture.erb similarity index 100% rename from actionpack/test/fixtures/test/update_element_with_capture.erb rename to actionview/test/fixtures/test/update_element_with_capture.erb diff --git a/actionpack/test/fixtures/test/utf8.html.erb b/actionview/test/fixtures/test/utf8.html.erb similarity index 100% rename from actionpack/test/fixtures/test/utf8.html.erb rename to actionview/test/fixtures/test/utf8.html.erb diff --git a/actionpack/test/fixtures/test/utf8_magic.html.erb b/actionview/test/fixtures/test/utf8_magic.html.erb similarity index 100% rename from actionpack/test/fixtures/test/utf8_magic.html.erb rename to actionview/test/fixtures/test/utf8_magic.html.erb diff --git a/actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb b/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb similarity index 100% rename from actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb rename to actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb diff --git a/actionpack/test/fixtures/topic.rb b/actionview/test/fixtures/topic.rb similarity index 100% rename from actionpack/test/fixtures/topic.rb rename to actionview/test/fixtures/topic.rb diff --git a/actionpack/test/fixtures/topics.yml b/actionview/test/fixtures/topics.yml similarity index 100% rename from actionpack/test/fixtures/topics.yml rename to actionview/test/fixtures/topics.yml diff --git a/actionpack/test/fixtures/topics/_topic.html.erb b/actionview/test/fixtures/topics/_topic.html.erb similarity index 100% rename from actionpack/test/fixtures/topics/_topic.html.erb rename to actionview/test/fixtures/topics/_topic.html.erb diff --git a/actionpack/test/fixtures/translations/templates/array.erb b/actionview/test/fixtures/translations/templates/array.erb similarity index 100% rename from actionpack/test/fixtures/translations/templates/array.erb rename to actionview/test/fixtures/translations/templates/array.erb diff --git a/actionpack/test/fixtures/translations/templates/default.erb b/actionview/test/fixtures/translations/templates/default.erb similarity index 100% rename from actionpack/test/fixtures/translations/templates/default.erb rename to actionview/test/fixtures/translations/templates/default.erb diff --git a/actionpack/test/fixtures/translations/templates/found.erb b/actionview/test/fixtures/translations/templates/found.erb similarity index 100% rename from actionpack/test/fixtures/translations/templates/found.erb rename to actionview/test/fixtures/translations/templates/found.erb diff --git a/actionpack/test/fixtures/translations/templates/missing.erb b/actionview/test/fixtures/translations/templates/missing.erb similarity index 100% rename from actionpack/test/fixtures/translations/templates/missing.erb rename to actionview/test/fixtures/translations/templates/missing.erb diff --git a/actionpack/test/fixtures/with_format.json.erb b/actionview/test/fixtures/with_format.json.erb similarity index 100% rename from actionpack/test/fixtures/with_format.json.erb rename to actionview/test/fixtures/with_format.json.erb diff --git a/actionview/test/lib/controller/fake_controllers.rb b/actionview/test/lib/controller/fake_controllers.rb new file mode 100644 index 000000000000..1a2863b6891c --- /dev/null +++ b/actionview/test/lib/controller/fake_controllers.rb @@ -0,0 +1,35 @@ +class ContentController < ActionController::Base; end + +module Admin + class AccountsController < ActionController::Base; end + class PostsController < ActionController::Base; end + class StuffController < ActionController::Base; end + class UserController < ActionController::Base; end + class UsersController < ActionController::Base; end +end + +module Api + class UsersController < ActionController::Base; end + class ProductsController < ActionController::Base; end +end + +class AccountController < ActionController::Base; end +class ArchiveController < ActionController::Base; end +class ArticlesController < ActionController::Base; end +class BarController < ActionController::Base; end +class BlogController < ActionController::Base; end +class BooksController < ActionController::Base; end +class CarsController < ActionController::Base; end +class CcController < ActionController::Base; end +class CController < ActionController::Base; end +class FooController < ActionController::Base; end +class GeocodeController < ActionController::Base; end +class NewsController < ActionController::Base; end +class NotesController < ActionController::Base; end +class PagesController < ActionController::Base; end +class PeopleController < ActionController::Base; end +class PostsController < ActionController::Base; end +class SubpathBooksController < ActionController::Base; end +class SymbolsController < ActionController::Base; end +class UserController < ActionController::Base; end +class UsersController < ActionController::Base; end diff --git a/actionview/test/lib/controller/fake_models.rb b/actionview/test/lib/controller/fake_models.rb new file mode 100644 index 000000000000..a463a08bb621 --- /dev/null +++ b/actionview/test/lib/controller/fake_models.rb @@ -0,0 +1,185 @@ +require "active_model" + +class Customer < Struct.new(:name, :id) + extend ActiveModel::Naming + include ActiveModel::Conversion + + undef_method :to_json + + def to_xml(options={}) + if options[:builder] + options[:builder].name name + else + "#{name}" + end + end + + def to_js(options={}) + "name: #{name.inspect}" + end + alias :to_text :to_js + + def errors + [] + end + + def persisted? + id.present? + end +end + +class GoodCustomer < Customer +end + +class Post < Struct.new(:title, :author_name, :body, :secret, :persisted, :written_on, :cost) + extend ActiveModel::Naming + include ActiveModel::Conversion + extend ActiveModel::Translation + + alias_method :secret?, :secret + alias_method :persisted?, :persisted + + def initialize(*args) + super + @persisted = false + end + + attr_accessor :author + def author_attributes=(attributes); end + + attr_accessor :comments, :comment_ids + def comments_attributes=(attributes); end + + attr_accessor :tags + def tags_attributes=(attributes); end +end + +class Comment + extend ActiveModel::Naming + include ActiveModel::Conversion + + attr_reader :id + attr_reader :post_id + def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end + def to_key; id ? [id] : nil end + def save; @id = 1; @post_id = 1 end + def persisted?; @id.present? end + def to_param; @id.to_s; end + def name + @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}" + end + + attr_accessor :relevances + def relevances_attributes=(attributes); end + + attr_accessor :body +end + +class Tag + extend ActiveModel::Naming + include ActiveModel::Conversion + + attr_reader :id + attr_reader :post_id + def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end + def to_key; id ? [id] : nil end + def save; @id = 1; @post_id = 1 end + def persisted?; @id.present? end + def to_param; @id; end + def value + @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}" + end + + attr_accessor :relevances + def relevances_attributes=(attributes); end + +end + +class CommentRelevance + extend ActiveModel::Naming + include ActiveModel::Conversion + + attr_reader :id + attr_reader :comment_id + def initialize(id = nil, comment_id = nil); @id, @comment_id = id, comment_id end + def to_key; id ? [id] : nil end + def save; @id = 1; @comment_id = 1 end + def persisted?; @id.present? end + def to_param; @id; end + def value + @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}" + end +end + +class Sheep + extend ActiveModel::Naming + include ActiveModel::Conversion + + attr_reader :id + def to_key; id ? [id] : nil end + def save; @id = 1 end + def new_record?; @id.nil? end + def name + @id.nil? ? 'new sheep' : "sheep ##{@id}" + end +end + +class TagRelevance + extend ActiveModel::Naming + include ActiveModel::Conversion + + attr_reader :id + attr_reader :tag_id + def initialize(id = nil, tag_id = nil); @id, @tag_id = id, tag_id end + def to_key; id ? [id] : nil end + def save; @id = 1; @tag_id = 1 end + def persisted?; @id.present? end + def to_param; @id; end + def value + @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}" + end +end + +class Author < Comment + attr_accessor :post + def post_attributes=(attributes); end +end + +class HashBackedAuthor < Hash + extend ActiveModel::Naming + include ActiveModel::Conversion + + def persisted?; false; end + + def name + "hash backed author" + end +end + +module Blog + def self.use_relative_model_naming? + true + end + + class Post < Struct.new(:title, :id) + extend ActiveModel::Naming + include ActiveModel::Conversion + + def persisted? + id.present? + end + end +end + +class ArelLike + def to_ary + true + end + def each + a = Array.new(2) { |id| Comment.new(id + 1) } + a.each { |i| yield i } + end +end + +class Car < Struct.new(:color) +end diff --git a/actionpack/test/template/active_model_helper_test.rb b/actionview/test/template/active_model_helper_test.rb similarity index 100% rename from actionpack/test/template/active_model_helper_test.rb rename to actionview/test/template/active_model_helper_test.rb diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb similarity index 100% rename from actionpack/test/template/asset_tag_helper_test.rb rename to actionview/test/template/asset_tag_helper_test.rb diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionview/test/template/atom_feed_helper_test.rb similarity index 100% rename from actionpack/test/template/atom_feed_helper_test.rb rename to actionview/test/template/atom_feed_helper_test.rb diff --git a/actionpack/test/template/capture_helper_test.rb b/actionview/test/template/capture_helper_test.rb similarity index 100% rename from actionpack/test/template/capture_helper_test.rb rename to actionview/test/template/capture_helper_test.rb diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionview/test/template/compiled_templates_test.rb similarity index 98% rename from actionpack/test/template/compiled_templates_test.rb rename to actionview/test/template/compiled_templates_test.rb index f5dc2fbb3394..2336321f3e3e 100644 --- a/actionpack/test/template/compiled_templates_test.rb +++ b/actionview/test/template/compiled_templates_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'controller/fake_models' class CompiledTemplatesTest < ActiveSupport::TestCase def setup diff --git a/actionpack/test/template/date_helper_i18n_test.rb b/actionview/test/template/date_helper_i18n_test.rb similarity index 100% rename from actionpack/test/template/date_helper_i18n_test.rb rename to actionview/test/template/date_helper_i18n_test.rb diff --git a/actionpack/test/template/date_helper_test.rb b/actionview/test/template/date_helper_test.rb similarity index 100% rename from actionpack/test/template/date_helper_test.rb rename to actionview/test/template/date_helper_test.rb diff --git a/actionpack/test/template/debug_helper_test.rb b/actionview/test/template/debug_helper_test.rb similarity index 100% rename from actionpack/test/template/debug_helper_test.rb rename to actionview/test/template/debug_helper_test.rb diff --git a/actionpack/test/template/dependency_tracker_test.rb b/actionview/test/template/dependency_tracker_test.rb similarity index 100% rename from actionpack/test/template/dependency_tracker_test.rb rename to actionview/test/template/dependency_tracker_test.rb diff --git a/actionpack/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb similarity index 100% rename from actionpack/test/template/digestor_test.rb rename to actionview/test/template/digestor_test.rb diff --git a/actionpack/test/template/erb/form_for_test.rb b/actionview/test/template/erb/form_for_test.rb similarity index 100% rename from actionpack/test/template/erb/form_for_test.rb rename to actionview/test/template/erb/form_for_test.rb diff --git a/actionpack/test/template/erb/helper.rb b/actionview/test/template/erb/helper.rb similarity index 100% rename from actionpack/test/template/erb/helper.rb rename to actionview/test/template/erb/helper.rb diff --git a/actionpack/test/template/erb/tag_helper_test.rb b/actionview/test/template/erb/tag_helper_test.rb similarity index 100% rename from actionpack/test/template/erb/tag_helper_test.rb rename to actionview/test/template/erb/tag_helper_test.rb diff --git a/actionpack/test/template/erb_util_test.rb b/actionview/test/template/erb_util_test.rb similarity index 100% rename from actionpack/test/template/erb_util_test.rb rename to actionview/test/template/erb_util_test.rb diff --git a/actionpack/test/template/form_collections_helper_test.rb b/actionview/test/template/form_collections_helper_test.rb similarity index 100% rename from actionpack/test/template/form_collections_helper_test.rb rename to actionview/test/template/form_collections_helper_test.rb diff --git a/actionpack/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb similarity index 100% rename from actionpack/test/template/form_helper_test.rb rename to actionview/test/template/form_helper_test.rb diff --git a/actionpack/test/template/form_options_helper_i18n_test.rb b/actionview/test/template/form_options_helper_i18n_test.rb similarity index 100% rename from actionpack/test/template/form_options_helper_i18n_test.rb rename to actionview/test/template/form_options_helper_i18n_test.rb diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionview/test/template/form_options_helper_test.rb similarity index 100% rename from actionpack/test/template/form_options_helper_test.rb rename to actionview/test/template/form_options_helper_test.rb diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb similarity index 100% rename from actionpack/test/template/form_tag_helper_test.rb rename to actionview/test/template/form_tag_helper_test.rb diff --git a/actionpack/test/template/html-scanner/cdata_node_test.rb b/actionview/test/template/html-scanner/cdata_node_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/cdata_node_test.rb rename to actionview/test/template/html-scanner/cdata_node_test.rb diff --git a/actionpack/test/template/html-scanner/document_test.rb b/actionview/test/template/html-scanner/document_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/document_test.rb rename to actionview/test/template/html-scanner/document_test.rb diff --git a/actionpack/test/template/html-scanner/node_test.rb b/actionview/test/template/html-scanner/node_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/node_test.rb rename to actionview/test/template/html-scanner/node_test.rb diff --git a/actionpack/test/template/html-scanner/sanitizer_test.rb b/actionview/test/template/html-scanner/sanitizer_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/sanitizer_test.rb rename to actionview/test/template/html-scanner/sanitizer_test.rb diff --git a/actionpack/test/template/html-scanner/tag_node_test.rb b/actionview/test/template/html-scanner/tag_node_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/tag_node_test.rb rename to actionview/test/template/html-scanner/tag_node_test.rb diff --git a/actionpack/test/template/html-scanner/text_node_test.rb b/actionview/test/template/html-scanner/text_node_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/text_node_test.rb rename to actionview/test/template/html-scanner/text_node_test.rb diff --git a/actionpack/test/template/html-scanner/tokenizer_test.rb b/actionview/test/template/html-scanner/tokenizer_test.rb similarity index 100% rename from actionpack/test/template/html-scanner/tokenizer_test.rb rename to actionview/test/template/html-scanner/tokenizer_test.rb diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionview/test/template/javascript_helper_test.rb similarity index 100% rename from actionpack/test/template/javascript_helper_test.rb rename to actionview/test/template/javascript_helper_test.rb diff --git a/actionpack/test/template/log_subscriber_test.rb b/actionview/test/template/log_subscriber_test.rb similarity index 100% rename from actionpack/test/template/log_subscriber_test.rb rename to actionview/test/template/log_subscriber_test.rb diff --git a/actionpack/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb similarity index 100% rename from actionpack/test/template/lookup_context_test.rb rename to actionview/test/template/lookup_context_test.rb diff --git a/actionpack/test/template/number_helper_test.rb b/actionview/test/template/number_helper_test.rb similarity index 100% rename from actionpack/test/template/number_helper_test.rb rename to actionview/test/template/number_helper_test.rb diff --git a/actionpack/test/template/output_buffer_test.rb b/actionview/test/template/output_buffer_test.rb similarity index 100% rename from actionpack/test/template/output_buffer_test.rb rename to actionview/test/template/output_buffer_test.rb diff --git a/actionpack/test/template/output_safety_helper_test.rb b/actionview/test/template/output_safety_helper_test.rb similarity index 100% rename from actionpack/test/template/output_safety_helper_test.rb rename to actionview/test/template/output_safety_helper_test.rb diff --git a/actionpack/test/template/record_identifier_test.rb b/actionview/test/template/record_identifier_test.rb similarity index 100% rename from actionpack/test/template/record_identifier_test.rb rename to actionview/test/template/record_identifier_test.rb diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionview/test/template/record_tag_helper_test.rb similarity index 100% rename from actionpack/test/template/record_tag_helper_test.rb rename to actionview/test/template/record_tag_helper_test.rb diff --git a/actionpack/test/template/render_test.rb b/actionview/test/template/render_test.rb similarity index 99% rename from actionpack/test/template/render_test.rb rename to actionview/test/template/render_test.rb index 81f3391fcdf7..8cffe73cce6d 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -376,6 +376,7 @@ def test_render_knows_about_types_registered_when_extensions_are_checked_earlier def test_render_ignores_templates_with_malformed_template_handlers ActiveSupport::Deprecation.silence do %w(malformed malformed.erb malformed.html.erb malformed.en.html.erb).each do |name| + assert File.exists?(File.expand_path("#{FIXTURE_LOAD_PATH}/test/malformed/#{name}~")), "Malformed file (#{name}~) which should be ignored does not exists" assert_raises(ActionView::MissingTemplate) { @view.render(:file => "test/malformed/#{name}") } end end diff --git a/actionpack/test/template/resolver_patterns_test.rb b/actionview/test/template/resolver_patterns_test.rb similarity index 100% rename from actionpack/test/template/resolver_patterns_test.rb rename to actionview/test/template/resolver_patterns_test.rb diff --git a/actionpack/test/template/sanitize_helper_test.rb b/actionview/test/template/sanitize_helper_test.rb similarity index 100% rename from actionpack/test/template/sanitize_helper_test.rb rename to actionview/test/template/sanitize_helper_test.rb diff --git a/actionpack/test/template/streaming_render_test.rb b/actionview/test/template/streaming_render_test.rb similarity index 99% rename from actionpack/test/template/streaming_render_test.rb rename to actionview/test/template/streaming_render_test.rb index 520bf3a82467..8a24d78e74d7 100644 --- a/actionpack/test/template/streaming_render_test.rb +++ b/actionview/test/template/streaming_render_test.rb @@ -1,6 +1,5 @@ # encoding: utf-8 require 'abstract_unit' -require 'controller/fake_models' class TestController < ActionController::Base end diff --git a/actionpack/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb similarity index 100% rename from actionpack/test/template/tag_helper_test.rb rename to actionview/test/template/tag_helper_test.rb diff --git a/actionpack/test/template/template_error_test.rb b/actionview/test/template/template_error_test.rb similarity index 100% rename from actionpack/test/template/template_error_test.rb rename to actionview/test/template/template_error_test.rb diff --git a/actionpack/test/template/template_test.rb b/actionview/test/template/template_test.rb similarity index 100% rename from actionpack/test/template/template_test.rb rename to actionview/test/template/template_test.rb diff --git a/actionpack/test/template/test_case_test.rb b/actionview/test/template/test_case_test.rb similarity index 99% rename from actionpack/test/template/test_case_test.rb rename to actionview/test/template/test_case_test.rb index acd002ce73a7..4ee093034132 100644 --- a/actionpack/test/template/test_case_test.rb +++ b/actionview/test/template/test_case_test.rb @@ -1,5 +1,4 @@ require 'abstract_unit' -require 'controller/fake_controllers' module ActionView diff --git a/actionpack/test/template/test_test.rb b/actionview/test/template/test_test.rb similarity index 100% rename from actionpack/test/template/test_test.rb rename to actionview/test/template/test_test.rb diff --git a/actionpack/test/template/testing/fixture_resolver_test.rb b/actionview/test/template/testing/fixture_resolver_test.rb similarity index 100% rename from actionpack/test/template/testing/fixture_resolver_test.rb rename to actionview/test/template/testing/fixture_resolver_test.rb diff --git a/actionpack/test/template/testing/null_resolver_test.rb b/actionview/test/template/testing/null_resolver_test.rb similarity index 100% rename from actionpack/test/template/testing/null_resolver_test.rb rename to actionview/test/template/testing/null_resolver_test.rb diff --git a/actionpack/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb similarity index 100% rename from actionpack/test/template/text_helper_test.rb rename to actionview/test/template/text_helper_test.rb diff --git a/actionpack/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb similarity index 100% rename from actionpack/test/template/translation_helper_test.rb rename to actionview/test/template/translation_helper_test.rb diff --git a/actionpack/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb similarity index 99% rename from actionpack/test/template/url_helper_test.rb rename to actionview/test/template/url_helper_test.rb index eb4349015a25..8373d7f9921a 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -1,6 +1,5 @@ # encoding: utf-8 require 'abstract_unit' -require 'controller/fake_controllers' class UrlHelperTest < ActiveSupport::TestCase diff --git a/ci/travis.rb b/ci/travis.rb index 9029c3f41cd6..7e689933325e 100755 --- a/ci/travis.rb +++ b/ci/travis.rb @@ -20,7 +20,8 @@ class Build 'am' => 'actionmailer', 'amo' => 'activemodel', 'as' => 'activesupport', - 'ar' => 'activerecord' + 'ar' => 'activerecord', + 'av' => 'actionview' } attr_reader :component, :options diff --git a/rails.gemspec b/rails.gemspec index 4a17beac6956..b426faf0e8e8 100644 --- a/rails.gemspec +++ b/rails.gemspec @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.add_dependency 'activesupport', version s.add_dependency 'actionpack', version + s.add_dependency 'actionview', version s.add_dependency 'activerecord', version s.add_dependency 'actionmailer', version s.add_dependency 'railties', version diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 05e9c4ab6e87..50253fe2bca7 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -345,7 +345,7 @@ def index #{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/locale/en.yml #{RAILS_FRAMEWORK_ROOT}/activemodel/lib/active_model/locale/en.yml #{RAILS_FRAMEWORK_ROOT}/activerecord/lib/active_record/locale/en.yml - #{RAILS_FRAMEWORK_ROOT}/actionpack/lib/action_view/locale/en.yml + #{RAILS_FRAMEWORK_ROOT}/actionview/lib/action_view/locale/en.yml #{@plugin.path}/config/locales/en.yml #{app_path}/config/locales/en.yml #{app_path}/app/locales/en.yml