diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake index f5ccc1a19b..c735c8dbb9 100644 --- a/railties/lib/tasks/testing.rake +++ b/railties/lib/tasks/testing.rake @@ -52,9 +52,14 @@ namespace :test do Rake::TestTask.new(:uncommitted => "db:test:prepare") do |t| def t.file_list changed_since_checkin = silence_stderr { `svn status` }.map { |path| path.chomp[7 .. -1] } - models = changed_since_checkin.select { |path| path =~ /app\/models\/.*\.rb/ } - tests = models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" } - tests.uniq + + models = changed_since_checkin.select { |path| path =~ /app\/models\/.*\.rb/ } + controllers = changed_since_checkin.select { |path| path =~ /app\/controllers\/.*\.rb/ } + + unit_tests = models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" } + functional_tests = controllers.map { |controller| "test/functional/#{File.basename(controller, '.rb')}_test.rb" } + + unit_tests.uniq + functional_tests.uniq end t.libs << 'test' @@ -94,4 +99,4 @@ namespace :test do t.verbose = true end -end \ No newline at end of file +end