Commit Graph

10505 Commits

Author SHA1 Message Date
Max Shytikov
310fc2b8c1 Refactor handling of action normalization
Reference:
Bloody mess internals
http://gusiev.com/slides/rails_contribution/static/#40
2013-07-26 09:49:07 +01:00
Akira Matsuda
fb97a7d87b Reset ActionView::Base.logger instead of AC::Base.logger
see: 9b0ac0bc74569db460f87ea6888b3847be0ff5be
2013-07-26 03:01:27 +09:00
Akira Matsuda
d9f1542fd3 Fix order dependent tests
Reset ActionView::Base.logger after tests
2013-07-26 03:01:26 +09:00
Akira Matsuda
24869e38af Fix order dependent AP test
any_instance.stubs + unstub with Mocha doesn't restore the original status in the following case,
so we need to undef Customer#to_json before every test

require 'test/unit'
require 'mocha/setup'

module M
  def foo() :foo; end
end

class C
  include M

  undef_method :foo
end

C.any_instance.stubs(:foo).returns(:mocha)

C.any_instance.unstub(:foo)
2013-07-26 03:01:26 +09:00
Ankit Gupta
c213bf174f Typo fix
[skip ci] Fixing the typo which is formed a not required link.  Check here http://api.rubyonrails.org/classes/ActionController/Base.html  under paramters section
keeping it under tt tag
2013-07-25 11:57:27 +01:00
Andrew White
4db0637d55 Allow overriding of all headers from passed environment hash
Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
the environment passed into `ActionDispatch::TestRequest.new`.

Fixes #11590
2013-07-25 07:54:57 +01:00
Max Vasiliev
0d477e40a8 Removed random dot in code sample [ci skip] 2013-07-22 16:13:18 +04:00
Andrew White
e5275f9b59 Clear named routes when routes.rb is reloaded
Fix an issue where Journey was failing to clear the named routes hash when the
routes were reloaded and since it doesn't overwrite existing routes then if a
route changed but wasn't renamed it kept the old definition. This was being
masked by the optimised url helpers so it only became apparent when passing an
options hash to the url helper.
2013-07-21 17:11:52 +01:00
Andrew White
1a58ac60d9 Refactor to reduce number of loops
Only build the missing_keys array once we have detected that there
actually are missing keys by moving the check to be part of the block
that performs the path substitution.
2013-07-17 10:46:20 +01:00
Andrew White
74722d66d3 Fix failing test missed for the past year :(
When optimized path helpers were re-introduced in d7014bc the test added
in a328f2f broke but no-one noticed because it wasn't being run by the
test suite.

Fix the test by checking for nil values or empty strings after the args
have been parameterized.
2013-07-17 08:56:34 +01:00
Arun Agrawal
96310f69e1 Added routing in test for actionpack 2013-07-17 08:55:24 +01:00
Andrew White
1555a1800e Skip Rack applications and redirects when generating urls
When generating an unnamed url (i.e. using `url_for` with an options
hash) we should skip anything other than standard Rails routes otherwise
it will match the first mounted application or redirect and generate a
url with query parameters rather than raising an error if the options
hash doesn't match any defined routes.

Fixes #8018
2013-07-16 13:39:17 +01:00
Arun Agrawal
ceb57c5148 Removed unused file! Moved to actionview
Removed unused file as this has been
moved to actionview
2013-07-13 18:44:28 +02:00
Yves Senn
3af7b16c11 add test-case to verify error.path when a helper was not found.
This verifies the code added with:
99c9d18601
2013-07-12 15:40:47 +02:00
Yves Senn
5bee14f3a4 move MissingHelperError out of the ClassMethods module. 2013-07-12 15:34:29 +02:00
Robin Dupret
b163754bc5 Add documentation for add_flash_types [ci skip]
Document a little bit the ActionController::Flash::add_flash_types
class method.
2013-07-10 20:55:05 +02:00
Marc Schütz
90e420e406 Remove accidentally committed vi .swp file. 2013-07-10 16:06:40 +02:00
Piotr Niełacny
e0438b1c07 Show real LoadError on helpers require
When helper try to require missing file rails will throw exception about
missing helper.

  # app/helpers/my_helper.rb

  require 'missing'

  module MyHelper
  end

And when we try do load helper

  class ApplicationController
    helper :my
  end

Rails will throw exception. This is wrong because there is a helper
file.

  Missing helper file helpers/my_helper.rb

Now when helper try to require non-existed file rails will throw proper
exception.

  No such file to load -- missing
2013-07-10 11:26:43 +02:00
Rafael Mendonça França
ae85a4aa98 Merge pull request #11351 from jetthoughts/cleanup_request
Use content_length method instead of ENV['CONTENT_LENGTH'].to_i
2013-07-09 01:47:43 -07:00
Paul Nikitochkin
f6746c0245 Use Request#raw_post instead Request#body
In order to get raw_post to be not empty after
ParamsParser#parse_formatted_parameters,
added rewinding of body stream input on parsing json params.

Closes #11345
2013-07-08 01:48:35 +03:00
Paul Nikitochkin
c61b3ce0f5 Use helper method to get ENV['CONTENT_LENGTH'] 2013-07-08 00:11:57 +03:00
Rafael Mendonça França
239126385f Merge pull request #11313 from gsamokovarov/url-encoded-params-test
Cleanup ul_encoded_params_parsing_test
2013-07-06 16:09:36 -07:00
Arun Agrawal
cbaf71b7dc Running isolated test for assertions and journey
in actionpack
2013-07-06 23:06:05 +02:00
Arun Agrawal
2d313efcb1 actionpack not having activerecord tests [ci skip] 2013-07-06 22:52:47 +02:00
Genadi Samokovarov
3db80b5496 Cleanup ul_encoded_params_parsing_test 2013-07-05 16:35:19 +03:00
Yamagishi Kazutoshi
ce89251bb2 Space is not required for Set-Cookie header 2013-07-05 15:40:14 +09:00
Yves Senn
1bf5fc293d remove useless env.merge!(env) from ActionDispatch::IntegrationTest` 2013-07-04 12:11:53 +02:00
Edho Arief
1ba0a1f87a Missing closing + in documentation [ci skip] 2013-07-04 16:47:43 +09:00
Carlos Antonio da Silva
bf12c35087 Remove deprecated Rails application fallback for integration testing
Set ActionDispatch.test_app instead.
2013-07-02 22:59:59 -03:00
Carlos Antonio da Silva
b990921f05 Remove deprecated constants autoload
These constants were removed in 4b97ce5eb16cc20207516387fba98bf577e2e281,
but I forgot to remove the autoload calls .
2013-07-02 22:53:37 -03:00
Neeraj Singh
70568b4bbd use extract_options! 2013-07-02 22:46:31 +05:30
Francesco Rodriguez
fa45401b82 Remove page_cache_extension deprecated method 2013-07-01 22:09:11 -05:00
Carlos Antonio da Silva
4b97ce5eb1 Remove deprecated constants from Action Controller
ActionController::AbstractRequest  => ActionDispatch::Request
  ActionController::Request          => ActionDispatch::Request
  ActionController::AbstractResponse => ActionDispatch::Response
  ActionController::Response         => ActionDispatch::Response
  ActionController::Routing          => ActionDispatch::Routing
  ActionController::Integration      => ActionDispatch::Integration
  ActionController::IntegrationTest  => ActionDispatch::IntegrationTest
2013-07-01 22:20:23 -03:00
Charlie Somerville
5e356de271 store a symbol directly inside DISPATCH_CACHE for extra roflscale 2013-06-30 11:31:36 +10:00
Aaron Patterson
3f81230a72 use bytesize rather than force encoding 2013-06-28 17:21:38 -07:00
Aaron Patterson
1b6aa27320 writing the new body can cause the response to be committed and the
request thread to return up the stack before the instance variable is
assigned.  Synchronize so that the ivar is assigned before the other
thread can activate.

fixes #10984
2013-06-28 16:51:53 -07:00
kennyj
db0499a6b6 Re-remove deprecated API. 2013-06-28 01:42:07 +09:00
Arun Agrawal
c4f588213b Minor changes to actionpack/actionview Rakefile 2013-06-26 10:22:10 +02:00
Carlos Antonio da Silva
dd9d869746 Merge pull request #11000 from sbeckeriv/accept_header
Fix undefined method `ref' for nil:NilClass for bad accept headers
2013-06-25 19:34:20 -03:00
Carlos Antonio da Silva
f02d4ddc99 Merge pull request #11046 from arunagw/verbose_mode_on
Verbose mode on when running tests
2013-06-25 15:15:43 -07:00
Akshay Khole
444d3412b9 Fixing Issue #11083
Removing other occurrences of `the` appearing twice
2013-06-25 16:47:29 +05:30
Andrew White
37b4276dbf Fix shorthand routes where controller and action are in the scope
Merge `:action` from routing scope and assign endpoint if both `:controller`
and `:action` are present. The endpoint assignment only occurs if there is
no `:to` present in the options hash so should only affect routes using the
shorthand syntax (i.e. endpoint is inferred from the the path).

Fixes #9856
2013-06-25 06:04:26 +01:00
Yves Senn
55d9176b4a test-case => failing 2013-06-25 05:52:07 +01:00
Guillermo Iguaran
d6bc2fa5a9 Merge pull request #11069 from ykzts/actiondispatch-ssl-secure-flag-igonore-case
Flag cookies as secure with ignore case in ActionDispatch::SSL
2013-06-24 14:24:03 -07:00
Yamagishi Kazutoshi
891fd78cd7 Flag cookies as secure with ignore case in ActionDispatch::SSL 2013-06-24 18:01:30 +09:00
Geoff Buesing
d8bf1f22de ActionDispatch:SSL: don't include STS header in non-https responses 2013-06-23 20:01:20 -05:00
Arun Agrawal
d88b390dfd Adding verbose in isolated test. 2013-06-21 14:14:36 +02:00
Arun Agrawal
67f668845e Saying gemcutter => rubygems [ci skip] 2013-06-21 11:04:52 +02:00
Piotr Sarnacki
50311f1391 Don't remove trailing slash from PATH_INFO for mounted apps
Previously when app was mounted as following:

    class Foo
      def call(env)
        [200, {}, [env['PATH_INFO']]]
      end
    end

    RackMountRailsBug::Application.routes.draw do
      mount RackTest.new => "/foo"
    end

trailing slash was removed from PATH_INFO. For example requesting

    GET /foo/bar/

on routes defined above would result in a response containing "/foo/bar"
instead of "/foo/bar/".

This commit fixes the issue.

(closes #3215)
2013-06-21 08:56:19 +02:00
Łukasz Strzałkowski
d1fb5d5949 Adjust changelog for AV & AP 2013-06-20 19:06:52 +02:00