aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling SCRIPT_NAME from within mounted engine'sPiotr Sarnacki2012-08-112-15/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you mount your application at a path, for example /myapp, server should set SCRIPT_NAME to /myapp. With such information, rails application knows that it's mounted at /myapp path and it should generate routes relative to that path. Before this patch, rails handled SCRIPT_NAME correctly only for regular apps, but it failed to do it for mounted engines. The solution was to hardcode default_url_options[:script_name], which is not the best answer - it will work only when application is mounted at a fixed path. This patch fixes the situation by respecting original value of SCRIPT_NAME when generating application's routes from engine and the other way round - when you generate engine's routes from application. This is done by using one of 2 pieces of information in env - current SCRIPT_NAME or SCRIPT_NAME for a corresponding router. This is because we have 2 cases to handle: - generating engine's route from application: in this situation SCRIPT_NAME is basically SCRIPT_NAME set by the server and it indicates the place where application is mounted, so we can just pass it as :original_script_name in url_options. :original_script_name is used because if we use :script_name, router will ignore generating prefix for engine - generating application's route from engine: in this situation we already lost information about the SCRIPT_NAME that server used. For example if application is mounted at /myapp and engine is mounted at /blog, at this point SCRIPT_NAME is equal /myapp/blog. Because of that we need to keep reference to /myapp SCRIPT_NAME by binding it to the current router. Later on we can extract it and use when generating url Please note that starting from now you *should not* use default_url_options[:script_name] explicitly if your server already passes correct SCRIPT_NAME to rack env. (closes #6933)
* remove some artifacts of dependent_restrict_raises that I missedJon Leighton2012-08-102-2/+0
|
* Remove the dependent_restrict_raises option.Jon Leighton2012-08-101-5/+0
| | | | | | | | | | | | | | | It's not really a good idea to have this as a global config option. We should allow people to specify the behaviour per association. There will now be two new values: * :dependent => :restrict_with_exception implements the current behaviour of :restrict. :restrict itself is deprecated in favour of :restrict_with_exception. * :dependent => :restrict_with_error implements the new behaviour - it adds an error to the owner if there are dependent records present See #4727 for the original discussion of this.
* make assertions easier to track downAaron Patterson2012-08-071-9/+17
|
* Revert "The application generator generates `public/humans.txt` with some ↵David Heinemeier Hansson2012-08-071-5/+0
| | | | basic data". I dont consider this something most people is going to want most of the time. If you want to add it in your own app, knock yourself out. But it doesnt belong in Rails imo
* Fix tests.Rafael Mendonça França2012-08-021-2/+2
| | | | | Since b6ab4417720e03f1551abda2f1e4bd0a392dd04e the single quotes are being escaped in the templates.
* Remove ActionDispatch::Head middleware in favor of Rack::HeadSantiago Pastorino2012-07-232-2/+8
| | | | Closes #7110 there's more work to do on rack-cache issue 69
* adding Rails::Queueing::ContainerAaron Patterson2012-07-192-5/+35
| | | | | | | | | | | | | | | This allows us to do: In your configuration: Rails.queue[:image_queue] = SomeQueue.new Rails.queue[:mail_queue] = SomeQueue.new In your app code: Rails.queue[:mail_queue].push MailJob.new Both jobs pushed to the same default queue Rails.queue.push DefaultJob.new Rails.queue[:default].push DefaultJob.new
* Add fkey attributes to `join_table` migration generatorAleksey Magusev2012-07-191-1/+1
|
* Merge pull request #7028 from lexmag/join_table_indexesJosé Valim2012-07-181-0/+13
|\ | | | | Add indexes to create_join_table method
| * Add join table migration generatorAleksey Magusev2012-07-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | For instance, running rails g migration CreateMediaJoinTable artists musics:uniq will create a migration with create_join_table :artists, :musics do |t| # t.index [:artist_id, :music_id] t.index [:music_id, :artist_id], unique: true end
* | Fix class_eval without __FILE__ and __LINE__.kennyj2012-07-181-1/+1
|/
* Merge pull request #6956 from lexmag/ref_migration_generatorRafael Mendonça França2012-07-081-0/+29
|\ | | | | Add references statements to migration generator
| * Add references statements to migration generatorAleksey Magusev2012-07-081-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | AddXXXToYYY/RemoveXXXFromYYY migrations are produced with references statements, for instance rails g migration AddReferencesToProducts user:references supplier:references{polymorphic} will generate the migration with: add_reference :products, :user, index: true add_reference :products, :supplier, polymorphic: true, index: true
* | Remove RoutesInspector from railties, since it was moved to APCarlos Antonio da Silva2012-07-081-168/+0
|/ | | | | Changes introduced in 7404cda9f61e41d52ce244d60abbf598684a96c4. Fix railties build.
* Fixed generating namespaced table_name_prefix in enginesWojciech Wnętrzak2012-07-061-1/+1
|
* Added failing test for generating namespaced table_name_prefix in enginesWojciech Wnętrzak2012-07-061-0/+12
|
* remove duplicate requires of mocha.Aaron Patterson2012-07-031-1/+0
| | | | | Mocha is already required by AS::TestCase, so remove the duplicate requires.
* remove test/dummy from gitignore when "plugin new -T"Francesco Rodriguez2012-07-031-1/+7
|
* Make TestQueueTest work with marshalling queuePaul Battley2012-07-031-25/+60
| | | | | This requires all jobs to be instances of named classes, without block implementations of methods.
* Ensure jobs do not refer to the queuePaul Battley2012-07-031-0/+15
| | | | | | | | Jobs pushed to the queue should not contain a reference to it. As the queue itself cannot be marshalled, and as a consequence of checking the marshallability of all jobs in the test environment, we can now guarantee this to be the case in the test environment when using the default TestQueue implementation.
* Ensure test jobs are marshallablePaul Battley2012-07-031-8/+28
| | | | | | | | | | By marshalling and unmarshalling jobs when adding them to the test queue, we can ensure that jobs created during test runs are valid candidates for marshalling, and, thus, that they can be used with queueing backends other than the default simple in-process implementation. This will also be used in a subsequent commit to ensure that jobs pushed to the queue do not contain a reference to the queue itself.
* Track queue threading with named classesPaul Battley2012-07-031-14/+24
| | | | | | | Using an anonymous class prevented marshalling: we're not doing that yet, but the next commit will introduce this. This also provided an opportunity to improve the expressivity of the tests and to make the assertion failure messages clearer.
* Made file name and class name consistantRahul P. Chaudhari2012-07-021-1/+1
|
* Fix failing test related to persist glob when replacing a pathCarlos Antonio da Silva2012-07-011-1/+1
| | | | Introduced in pull request #6910, merged in 2ee3fa1a48513a2c42833e2e1f60fe03769bc295
* Merge pull request #6910 from mulder/fix_path_globJosé Valim2012-07-011-0/+7
|\ | | | | Persist glob when replacing a path
| * Persist glob when replacing a pathNicholas Mulder2012-06-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Rails::Paths::Root's []= is used to replace a path it should persist the previous path's glob. Without passing the glob along we get gnarly bugs when trying to wire up things like engines. module FooEngine class Engine < ::Rails::Engine isolate_namespace FooEngine config.paths['config/initializers'] = "lib/foo_engine/initializers" end end ## Example of behaviour before this commit. # # Before the initializer override: >> FooEngine::Engine.config.paths["config/initializers"].glob => "**/*.rb" # After the initializer override: >> FooEngine::Engine.config.paths["config/initializers"].glob => nil ## Example of behaviour after this commit. # # Before the initializer override: >> FooEngine::Engine.config.paths["config/initializers"].glob => "**/*.rb" # After the initializer override: >> FooEngine::Engine.config.paths["config/initializers"].glob => "**/*.rb"
* | Remove another missing test related to draw external routesCarlos Antonio da Silva2012-06-291-10/+0
| | | | | | | | Related with 5e7d6bb
* | Revert "Allow loading external route files from the router"José Valim2012-06-293-87/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b. Usage of this feature did not reveal any improvement in existing apps. Conflicts: actionpack/lib/action_dispatch/routing/mapper.rb guides/source/routing.textile railties/lib/rails/engine.rb railties/lib/rails/paths.rb railties/test/paths_test.rb
* | Remove unused responsibilities and add a few load definitions to enginesJosé Valim2012-06-291-1/+1
|/ | | | | | | | Since plugins were removed, we can clean up a few methods in engines. We also use this opportunity to move `load_console`, `load_tasks` and `load_runner` to Rails::Engine. This means that, if someone wants to improve script/rails for engines to support console or runner commands, part of the work is already done.
* Remove unnecessary Railties structure now that plugins are goneJosé Valim2012-06-291-11/+5
|
* Rename RouteInspect to RoutesInspector for consistencyJosé Valim2012-06-291-2/+2
|
* Merge pull request #6880 from kennyj/fix_20120628Carlos Antonio da Silva2012-06-271-1/+1
|\ | | | | Fix wrong testcase for db:test:prepare, and wrong environment in AR rake task.
| * Fix wrong testcase. This is a testcase for db:test:prepare.kennyj2012-06-281-1/+1
| |
* | Merge pull request #6856 from lexmag/polymorphic_generatorsCarlos Antonio da Silva2012-06-272-11/+29
|\ \ | |/ |/| | | | | | | | | | | | | Add polymorphic option to model generator For instance, $ rails g model Product supplier:references{polymorphic} generate model with `belongs_to :supplier, polymorphic: true` association and appropriate migration.
| * Add polymorphic option to model generatorAleksey Magusev2012-06-272-11/+29
| | | | | | | | | | | | | | | | | | | | For instance, $ rails g model Product supplier:references{polymorphic} generate model with `belongs_to :supplier, polymorphic: true` association and appropriate migration. Also fix model_generator_test.rb#L196 and #L201
* | Change the behavior of db:test:prepare task when schema_format is sql for ↵kennyj2012-06-261-0/+9
| | | | | | | | consistency.
* | Change the behavior of db:test:clone task when schema_format is sql for ↵kennyj2012-06-261-0/+9
|/ | | | consistency.
* ruby 1.9 hash syntax for generated codeRichard Huang2012-06-231-4/+4
| | | | | | | | app/controllers/application_controller.rb app/views/layouts/application.html.erb config/application.rb config/routes.rb test/performance/browsing_test.rb
* Run the logger tests in isolationRafael Mendonça França2012-06-191-0/+2
|
* run the notes tests in isolationAaron Patterson2012-06-191-0/+4
|
* run railties tests in parallel, default to 2 coresAaron Patterson2012-06-191-2/+0
|
* join any extra args to the tmp pathAaron Patterson2012-06-191-0/+1
|
* expand the tmpdir to the realpath so tests on OS X passAaron Patterson2012-06-192-2/+2
|
* use system tmpdir rather than our ownAaron Patterson2012-06-192-11/+16
|
* Don't read csv file during executing db:fixtures:load.kennyj2012-06-171-0/+12
|
* TestCase does not need to be loaded when loading the frameworkAaron Patterson2012-06-151-1/+10
|
* Fix observers with AR::ModelJon Leighton2012-06-151-0/+21
|
* Fix config.active_record.whitelist_attributes with AR::ModelJon Leighton2012-06-151-3/+4
|
* Merge pull request #6690 from suginoy/fix-templates-copyRafael Mendonça França2012-06-111-0/+11
|\ | | | | Fix: 'rake rails:templates:copy' doesn't work