Commit Graph

12509 Commits

Author SHA1 Message Date
Sven Winkler
7c5e4227d1 Add documentation to get a running custom base controller [ci skip] 2015-07-23 23:55:35 +02:00
Aaron Patterson
52cf1a71b3 rm deep_munge. You will live on in our hearts (and git history)
Now that we have encoding strategies, we can just walk the params hash
once to encode as HWIA, and remove nils.
2015-07-21 18:14:18 -07:00
Aaron Patterson
3f299296d1 push param encoding in to the utils module
we'll refactor deep munge mostly out of existence shortly
2015-07-21 18:04:12 -07:00
Aaron Patterson
f620d6c25e stop keeping track of keys when "deep munging"
This should have been done along with 8f8ccb9901cab457c6e1d52bdb25acf658fd5777
2015-07-21 17:57:50 -07:00
Aaron Patterson
14e8377232 recurse for arrays in normalize_encode_params
this just pushes the conditional in to the case / when so we can switch
to method dispatch later
2015-07-21 17:49:30 -07:00
Aaron Patterson
5046d5179e drop conditionals in conversion logic
there is no reason to `convert_hashes_to_parameters` with an assignemt
flag.  The caller knows whether or not it wants the value assigned.  We
should just change the uncommon case (not writing to the underlying
hash) to just call the conversion method and return that value.
2015-07-21 15:10:14 -07:00
Aaron Patterson
c75153d280 rearrange logic to use positive branches
only hashes are converted to parameter objects, so lets add a branch for
them.  This also removes a is_a? test for Parameters so we can be
abstracted from the class.
2015-07-21 15:04:19 -07:00
Rafael Mendonça França
8ff777f6f8 Merge pull request #20751 from repinel/remove-unnecessary-dup
Remove unnecessary `dup` from Mapper `add_route`
2015-07-20 23:40:54 -03:00
Roque Pinel
12b0b26df7 Fix state being carried over from previous transaction
This clears the transaction record state when the transaction finishes
with a `:committed` status.

Considering the following example where `name` is a required attribute.
Before we had `new_record?` returning `true` for a persisted record:

```ruby
  author = Author.create! name: 'foo'
  author.name = nil
  author.save        # => false
  author.new_record? # => true
```
2015-07-20 09:12:01 -06:00
Sean Griffin
f91439d848 Merge pull request #20946 from schneems/schneems/let-it-go
Freeze string literals when not mutated.
2015-07-19 17:09:13 -06:00
schneems
5bb1d4d288 Freeze string literals when not mutated.
I wrote a utility that helps find areas where you could optimize your program using a frozen string instead of a string literal, it's called [let_it_go](https://github.com/schneems/let_it_go). After going through the output and adding `.freeze` I was able to eliminate the creation of 1,114 string objects on EVERY request to [codetriage](codetriage.com). How does this impact execution?

To look at memory:

```ruby
require 'get_process_mem'

mem = GetProcessMem.new
GC.start
GC.disable
1_114.times { " " }
before = mem.mb

after = mem.mb
GC.enable
puts "Diff: #{after - before} mb"

```

Creating 1,114 string objects results in `Diff: 0.03125 mb` of RAM allocated on every request. Or 1mb every 32 requests.

To look at raw speed:

```ruby
require 'benchmark/ips'

number_of_objects_reduced = 1_114

Benchmark.ips do |x|
  x.report("freeze")    { number_of_objects_reduced.times { " ".freeze } }
  x.report("no-freeze") { number_of_objects_reduced.times { " " } }
end
```

We get the results

```
Calculating -------------------------------------
              freeze     1.428k i/100ms
           no-freeze   609.000  i/100ms
-------------------------------------------------
              freeze     14.363k (± 8.5%) i/s -     71.400k
           no-freeze      6.084k (± 8.1%) i/s -     30.450k
```

Now we can do some maths:

```ruby
ips = 6_226k # iterations / 1 second
call_time_before = 1.0 / ips # seconds per iteration 

ips = 15_254 # iterations / 1 second
call_time_after = 1.0 / ips # seconds per iteration 

diff = call_time_before - call_time_after

number_of_objects_reduced * diff * 100

# => 0.4530373333993266 miliseconds saved per request
```

So we're shaving off 1 second of execution time for every 220 requests. 

Is this going to be an insane speed boost to any Rails app: nope. Should we merge it: yep. 

p.s. If you know of a method call that doesn't modify a string input such as [String#gsub](b0e2da69f0/lib/let_it_go/core_ext/string.rb (L37)) please [give me a pull request to the appropriate file](b0e2da69f0/lib/let_it_go/core_ext/string.rb (L37)), or open an issue in LetItGo so we can track and freeze more strings. 

Keep those strings Frozen

![](https://www.dropbox.com/s/z4dj9fdsv213r4v/let-it-go.gif?dl=1)
2015-07-19 17:45:10 -05:00
Sean Griffin
e19acbb883 Merge pull request #20936 from repinel/fix-params-fetch-exception-overwritten
Fix exception overwritten for parameters fetch method
2015-07-19 15:57:57 -06:00
Eliot Sykes
2dcd0016e8 Fix formatting of force_ssl options documentation [ci skip] 2015-07-19 10:18:01 +01:00
Roque Pinel
780af27bf9 Fix exception overwritten for parameters fetch method
When executing an `ActionController::Parameters#fetch` with a block
that raises a `KeyError` the raised `KeyError` will be rescued and
converted to an `ActionController::ParameterMissing` exception,
covering up the original exception.

[Jonas Schubert Erlandsson & Roque Pinel]
2015-07-18 18:48:41 -04:00
Prem Sichanugrist
8cb8ce98d9 Stop using deprecated render :text in test
This will silence deprecation warnings.

Most of the test can be changed from `render :text` to render `:plain`
or `render :body` right away. However, there are some tests that needed
to be fixed by hand as they actually assert the default Content-Type
returned from `render :body`.
2015-07-17 22:27:33 -04:00
Jeremy Daer (Kemper)
0db98b3ec8 Merge pull request #20917 from sikachu/ps-deprecate-render-text
Add deprecation warning for `render :text`
2015-07-17 18:17:47 -07:00
Prem Sichanugrist
6790228b39 Add deprecation warning for render :text
We've started on discouraging the usage of `render :text` in #12374.
This is a follow-up commit to make sure that we print out the
deprecation warning.
2015-07-17 21:12:47 -04:00
Aaron Patterson
0fedae636e push fields_for_style? in to a protected method
this way we don't need to call `to_unsafe_h` to get access to ask
questions about the underlying hash
2015-07-17 14:43:06 -07:00
Aaron Patterson
e956172b8b push is_a checks up the stack
now `hash_filter` doesn't need to know about the `Parameters` class
2015-07-17 14:26:47 -07:00
Aaron Patterson
7779e63371 remove useless conditional
Since we proved that `element` is always of type `Parameter`, we know
that it will always respond to `permit`, so lets remove this conditional
2015-07-17 14:18:47 -07:00
Aaron Patterson
89448a7f5c remove useless conditionals
`element` can never be a hash because:

1. `slice` returns a Parameters object and calls each on it: cb3f25593b/actionpack/lib/action_controller/metal/strong_parameters.rb (L656)
2. `each` which is implemented by `each_pair` will call `convert_hashes_to_parameters` on the value: cb3f25593b/actionpack/lib/action_controller/metal/strong_parameters.rb (L192-197)
3. `convert_hashes_to_parameters` will convert any hash objects in to parameters objects: cb3f25593b/actionpack/lib/action_controller/metal/strong_parameters.rb (L550-566)
2015-07-17 14:08:12 -07:00
Aaron Patterson
cb3f25593b remove useless function
Now that the value is cached on the stack,
`array_of_permitted_scalars_filter` is exactly the same as
`array_of_permitted_scalars?`, so lets just have one
2015-07-17 13:36:33 -07:00
Aaron Patterson
2df8e86caf stop passing params to array_of_permitted_scalars_filter
this way the method doesn't have to know what the new params object is,
it just yields to a block.  This change also caches the value of
`self[key]` on the stack
2015-07-17 13:36:33 -07:00
Aaron Patterson
55d0e6f877 push key checking up
We should disconnect `array_of_permitted_scalars_filter` from the
instance so that we can make hash filtering functional.  For now, pull
the conditional up out of that method
2015-07-17 13:36:33 -07:00
Jon Atack
ea747f7d2e [skip ci] Lookup can be a noun but it is not a verb
Various grammar corrections and wrap to 80 characters.
2015-07-17 20:18:57 +02:00
Robin Dupret
ae1b96cfcd Skip a few failing tests on JRuby with the attached tickets 2015-07-17 15:00:00 +02:00
Akira Matsuda
022c676aee Oops! 💣 2015-07-17 18:31:59 +09:00
Akira Matsuda
8b3c68399f "warning: instance variable @routes not initialized" 2015-07-17 18:29:52 +09:00
Zoltan Kiss
ea6e7ffd78 Standardize ActionController::Parameters#to_unsafe_h return value
`ActionController::Parameters#to_h` returns a hash, so lets have
`ActionController::Parameters#to_unsafe_h` return a hash instead of
an `ActiveSupport::HashWithIndifferentAccess` for consistency.
2015-07-15 19:20:21 -05:00
Prem Sichanugrist
84b861f1aa Update documentation on AC::Parameters 2015-07-15 13:02:53 -04:00
Prem Sichanugrist
14a3bd520d Make AC::Parameters not inherited from Hash
This is another take at #14384 as we decided to wait until `master` is
targeting Rails 5.0. This commit is implementation-complete, as it
guarantees that all the public methods on the hash-inherited Parameters
are still working (based on test case). We can decide to follow-up later
if we want to remove some methods out from Parameters.
2015-07-15 11:11:36 -04:00
Aaron Patterson
4d4d764ab6 Rack implements redirect? so we don't need it
Rack [already implements `redirect?` on the response object](1569a985e1/lib/rack/response.rb (L141)) so we don't need to implement our own.
2015-07-14 11:22:35 -07:00
Rafael Mendonça França
8aadbeb3de Remove concurrent-ruby from Action Pack gemspec
It is already on Active Support
2015-07-14 15:17:41 -03:00
Aaron Patterson
468a55b741 Merge pull request #20866 from jdantonio/countdown-latch
Replace `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch` from concurrent-ruby.
2015-07-14 11:06:20 -07:00
Rafael Mendonça França
7645a5f85d Merge pull request #20877 from sikachu/rename-ac-test_response
Change AC::TestResponse to AD::TestResponse
2015-07-14 12:26:30 -03:00
Aaron Patterson
9cff248469 only call methods that are on the superclass
We want to treat the response object as if it's a real response object
(not a test object), so we should only call methods that are on the
superclass.
2015-07-14 07:46:17 -07:00
Prem Sichanugrist
e26d11c876 Change AC::TestResponse to AD::TestResponse
ActionController::TestResponse was removed in d9fe10c and caused a test
failure on Action View as its test case still refers to it.
2015-07-14 09:27:42 -04:00
Aaron Patterson
908bc79729 use a lookup table for assert_response
We shouldn't depend on specific methods imlemented in the TestResponse
subclass because the response could actually be a real response object.

In the future, we should either push the aliased predicate methods in
TestResponse up to the real response object, or remove them
2015-07-13 18:10:36 -07:00
Aaron Patterson
d9fe10cb8a only have one TestResponse class 2015-07-13 17:52:02 -07:00
Aaron Patterson
b37e29ec2d move buffer caching on to the buffer 2015-07-13 17:48:56 -07:00
Robin Dupret
48609420b8 Merge pull request #20736 from antoine-lizee/docs
[ci skip] docs: making clear that perform_caching has a limited impact
2015-07-13 22:41:45 +02:00
Jerry D'Antonio
284a9ba8ec Replaced ActiveSupport::Concurrency::Latch with concurrent-ruby.
The concurrent-ruby gem is a toolset containing many concurrency
utilities. Many of these utilities include runtime-specific
optimizations when possible. Rather than clutter the Rails codebase with
concurrency utilities separate from the core task, such tools can be
superseded by similar tools in the more specialized gem. This commit
replaces `ActiveSupport::Concurrency::Latch` with
`Concurrent::CountDownLatch`, which is functionally equivalent.
2015-07-13 15:44:21 -04:00
antoine.lizee
89a55edd59 [ci skip] doc: making clear that perform_caching has a limited impact 2015-07-13 11:35:18 -07:00
Claudio B.
e0a7e7b0ee Merge pull request #20842 from TheBlasfem/removed_usage_lines_docs
Removed usage line docs [ci skip]
2015-07-11 22:38:05 -07:00
Julio Lopez
789a2df86e added description instead of remove usage [ci skip] 2015-07-11 21:28:07 -05:00
Aaron Patterson
8f81f7a73d Merge pull request #17102 from matthewd/load-interlock
Concurrent load interlock (rm Rack::Lock)
2015-07-10 15:42:08 -07:00
Aaron Patterson
3c5bd78ddb we don't really need an extra method to set the script name 2015-07-10 14:19:11 -07:00
Aaron Patterson
85903d1b08 Remove useless conditional
PATH_INFO is already set, so this branch will never execute.
2015-07-10 14:19:11 -07:00
Aaron Patterson
e459b29fb4 default PATH_INFO to the generated path
we were already generating a path in the previous code (it was just not
returned), so lets just use the already computed path to popluate the
PATH_INFO header
2015-07-10 14:19:11 -07:00
Aaron Patterson
8b4eca09a5 always default the SCRIPT_NAME to whatever is on the controller 2015-07-10 14:19:11 -07:00
Aaron Patterson
889a4a3da0 remove useless ivar clearing
Since we only work with new instances, these ivars will not be set.
2015-07-10 14:19:11 -07:00
Aaron Patterson
314ac0cd57 call the path_parameters= setter rather than rely on mutations
We should call the setter on `path_parameters` so that we know the hash
will only contain the values that we've set.
2015-07-10 14:19:10 -07:00
Aaron Patterson
f1fcf9b526 start collecting env mutations
I'd like to put all env mutations together so we can understand how to
change this code to call `call` on the controller
2015-07-10 14:19:10 -07:00
Aaron Patterson
0adb8f8fa6 Parameters are converted to a query string
Since parameters are converted to a query string, they will
automatically be turned in to strings by the query parser
2015-07-10 14:19:10 -07:00
Aaron Patterson
11bc078928 no more HWIA
non_path_parameters is used internally (it never escapes this method) so
we should be able to safely use a regular hash.
2015-07-10 14:19:10 -07:00
Aaron Patterson
79ab812663 remove param dup'ing logic
since we are serializing parameters, we don't need to do all the dup
checks on each object.
2015-07-10 14:19:10 -07:00
Aaron Patterson
c546a2b045 encode / decode parameters before assigning them to the request
We should roundtrip the parameters through their respective encoders /
decoders so that the controller will get parameters similar to what they
actually get in a real world situation
2015-07-10 14:19:10 -07:00
Aaron Patterson
f3bae24c81 start disconnecting the parameter parser from the instance
pass in the instance variable to start decoupling the meat of the parser
from the instance of the middleware
2015-07-10 11:53:06 -07:00
Aaron Patterson
a1d7d65f0a drop a conditional by always assigning
We will always make an assignment to the env hash and eliminate a
conditional
2015-07-10 11:53:05 -07:00
Aaron Patterson
eb10496a1c drop runtime conditionals in parameter parsing
If we only deal with proc objects, then we can eliminate type checking
in the parameter parsing middleware
2015-07-09 14:56:38 -07:00
Aaron Patterson
140d5a3b2f use Rack::Test::UploadedFile when uploading files
We should use rack-test's upload file objects on the test side so that
we will be able to correctly generate mime blob posts in the future
2015-07-09 11:51:45 -07:00
Aaron Patterson
394b7be036 set parameters as a query string
We should convert request parameters to a query string, then let the
request object parse that query string.  This should give us results
that are more similar to the real-world
2015-07-09 10:12:19 -07:00
Aaron Patterson
40ed4eefe4 use JSON to communicate between the controller and the tests 2015-07-09 07:50:41 -07:00
Aaron Patterson
5ea8efecd0 build and assign parameters rather than rely on mutations
We should assign parameters to the request object rather than mutate the
hash that is returned by `query_parameters` or `request_parameters`
2015-07-08 16:43:58 -07:00
Aaron Patterson
9f09848918 assign the cookie hash on request allocation
this prevents mutations from being available globally
2015-07-08 16:27:02 -07:00
Aaron Patterson
f65fd25f04 request objects are no longer recycled
Instead of trying to manually clear out a request object, lets just
allocate a new one.  The rack ENV is reused and cleaned (still), but the
request object is not.
2015-07-08 16:23:32 -07:00
Aaron Patterson
b5a9525932 pass the variant as a parameter to more reflect real world apps 2015-07-08 16:15:50 -07:00
Aaron Patterson
78a5124bf0 add a new constructor for allocating test requests 2015-07-08 16:09:49 -07:00
Aaron Patterson
db41f33d7c make env a required parameter 2015-07-08 15:59:30 -07:00
Aaron Patterson
3cae6bc5fc pass the starting env and session to build_request 2015-07-08 15:17:50 -07:00
Aaron Patterson
4b1a0adf54 remove call to build_request 2015-07-08 15:14:41 -07:00
Aaron Patterson
3806eb70a6 pass the session and env in to the test request 2015-07-08 14:32:54 -07:00
Aaron Patterson
460079a771 let the superclass build the request and response
We should leverage the request / response objects that the superclass
has already allocated for us.
2015-07-08 14:15:53 -07:00
Aaron Patterson
ef2d7a69ec remove useless new implementation 2015-07-08 11:39:55 -07:00
Aaron Patterson
2b5d309aeb allocate new responses rather than recycling them
There is no reason to "recycle" response objects when we can just
allocate a new one.
2015-07-08 11:16:44 -07:00
Matthew Draper
48a735aff7 Fix the Interlock middleware
We can't actually lean on Rack::Lock's implementation, so we'll just
copy it instead. It's simple enough that that's not too troubling.
2015-07-09 03:31:31 +09:30
Matthew Draper
c37d47e308 Soften the lock requirements when eager_load is disabled
We don't need to fully disable concurrent requests: just ensure that
loads are performed in isolation.
2015-07-09 02:23:23 +09:30
Aaron Patterson
59a9068c3f pass variants in rather than mutating the request.
Variants are typically set in the controller based on some attribute of
the request that the browser sent.  We should make our tests more in
line with reality by doing the same and not mutating the request object.
2015-07-07 15:51:01 -07:00
eileencodes
8363b879fe pass cookies from the jar in the HTTP_COOKIE header
we should be pushing the cookies in via headers rather than maintaining
some object and "recycling" it.
2015-07-07 14:31:34 -07:00
eileencodes
ae29142142 Send cookies with request 2015-07-07 14:31:34 -07:00
Arthur Nogueira Neves
e598967548 Merge pull request #13897 from gmalette/nested-parameter-filtering-2
Allow filtering params based on parent keys
2015-07-06 16:33:01 +02:00
Matthew Draper
3046c9bbe1 Merge pull request #20782 from kaspth/fix-controller-caching-test
Fix the random caching test failure. (Take two)
2015-07-06 05:24:50 +09:30
eileencodes
a05e245ca5 Refactor cookie_jar to decouple it from request object
This change decouples `cookie_jar` allocation from the request object.
We need this for moving controller tests to integration tests so we can
access the `cookie_jar` object separately.
2015-07-05 12:59:24 -04:00
Kasper Timm Hansen
90ebba6836 Fix the random caching test failure. 2015-07-05 13:53:20 +02:00
claudiob
352c8473ef [ci skip] Don't use TrueClass, FalseClass in docs
This sort of documentation style comes from 2009, probably due to
the merging of merb (see 38b608ecab (diff-017d9bc9b1d2bdae199b938d72c15488R120)).

Rails follows Ruby's convention to define which values are "truthy" or
"falsey", so there is no need to specify that the returned value must
strictly be a TrueClass or FalseClass. /cc @fxn
2015-07-02 08:08:46 -07:00
Roque Pinel
da2aa29589 Remove unnecessary dup from Mapper add_route
The `dup` was introduced by c4106d0c08954b0761726e0015ec601b7bc7ea4b
to work around a frozen key. Nowadays, the string is already being
duplicated by the `tr` in `options[:action] ||= action.tr('-', '_')`
and later joined into a new string in `name_for_action`.
2015-07-01 16:13:20 -05:00
Roque Pinel
48dc8261e3 [ci skip] Improve the url_for documentation
Clarify the `url_for` usage in mailers.

Re-add the documentation about `url_for` and Route's path parameters,
first introduced by 5c4f1859970d06228a0b67cad6d4486c1526ef2a.
This was reported on #15097 and until it is decided to deprecate it
or not, I believe the documentation should exist.
2015-07-01 10:18:13 -05:00
eileencodes
4d7b507073 Improve error messages in cookies_test
Using `assert_predicate` and `assert_match` instead of just `assert` is
preferrable because better error messages are output.

In the case of `assert response.cookies.empty?` the error message was
`Failed assertion, no message given.` but now with `assert_predicate` it
will be `Expected {"user_name"=>"david"} to be empty?.`

For `assert_match(/user_name=david/,
response.headers["Set-Cookie"])` as well, the message returned was
unhelpful - `Failed assertion, no message given.` but now will tell what
was expected and what was returned with `Expected /user_name=david/ to
match "user_name=nope; path=/".`
2015-06-27 16:48:20 -04:00
Kasper Timm Hansen
991e98f564 Merge pull request #20276 from davetron5000/revert-head-on-no-template
Allow default_render to take a block to customize behavior when there's no template
2015-06-27 22:18:17 +02:00
Claudio B.
7814d80897 Merge pull request #20664 from vngrs/remove_mistaken_end_from_doc
Remove mistaken end from controller_path doc [ci skip]
2015-06-22 15:46:28 -07:00
Rafael Mendonça França
75b63de5ed Merge pull request #19431 from hmarr/head-routing
Respect routing precedence for HEAD requests
2015-06-22 19:34:37 -03:00
Mehmet Emin İNAÇ
b835c72bc9 Remove mistaken end from controller_path doc [ci skip] 2015-06-22 19:36:01 +03:00
Guillaume Malette
33b93174f0 Allow filtering params based on parent keys
Add the possibility to only filter parameters based on
their full path instead of relying on the immediate key.

    config.filter_parameters += ['credit_card.code']

    { 'credit_card' => { 'code' => '[FILTERED]' },
      'source' => { 'code' => '<%= puts 5 %>' } }
2015-06-22 10:04:11 -04:00
Yves Senn
8bf60b02b8 Merge pull request #20659 from vngrs/strong_parameters_unpermitted_parameters_wrong_doc_fix
Fix the documentation about ActionController::UnpermittedParameters [ci skip]
2015-06-22 08:49:27 +02:00
Mehmet Emin İNAÇ
9f62180ab2 Fix the documentation about ActionController::UnpermittedParameters [ci skip] 2015-06-22 07:28:51 +03:00
Mehmet Emin İNAÇ
2489a27d4d Fix the documentation about ActionController::ParameterMissing [ci skip] 2015-06-22 05:02:09 +03:00
Dave Copeland
6fda6c3778 Override default_render's behavior with a block
In 0de4a23 the behavior when there is a missing template was changed to
not raise an error, but instead head :no_content.  This is a breaking
change and some gems rely on this happening.

To allow gems and other code to work around this, allow
`default_render` to take a block which, if provided, will
execute the contents of that block instead of doing the `head :no_content`.
2015-06-20 12:00:07 -04:00
Arthur Neves
ffba8f79a2
Revert "Merge pull request #20584 from arthurnn/fix_url"
This reverts commit 0b3397872582f2cf1bc6960960a6393f477c55e6, reversing
changes made to 56d52e3749180e6c1dcf7166adbad967470aa78b.

As pointed out on the PR, this will hide development mistakes too, which
is not ideal.
2015-06-17 20:17:44 +02:00
Mehmet Emin İNAÇ
422292dc98 Document, refactor and create test case for ActionDispatch::Response#charset= method 2015-06-17 00:58:50 +03:00
Arthur Nogueira Neves
0b33978725 Merge pull request #20584 from arthurnn/fix_url
Catch InvalidURIError on bad paths on redirect.
2015-06-16 23:28:51 +02:00
Arthur Neves
e23b314945
Catch InvalidURIError on bad paths on redirect.
Handle URI::InvalidURIError errors on the redirect route method, so it
wont raise a 500 if a bad path is given.
2015-06-16 23:27:49 +02:00
Mehmet Emin İNAÇ
336c196351 Fix the comment about attr_reader of headers [ci skip] 2015-06-16 23:53:57 +03:00
Aaron Patterson
50176b59fa remove header= on the response object.
People should be free to mutate the header object, but not to set a new
header object.  That header object may be specific to the webserver, and
we need to hide it's internals.
2015-06-15 17:54:08 -07:00
Aaron Patterson
dd8c76d9b9 set the default charset in response initialize
this way we don't have to mutate the instance (as much) when writing a
rack response
2015-06-15 16:09:44 -07:00
Mehmet Emin İNAÇ
cf81a3bae0 Deprecate passing hash as first parameter into ActionController::Head 2015-06-15 23:53:45 +03:00
Kasper Timm Hansen
374b163999 Fix flakyness.
Brought on by my own stupidity :)
2015-06-15 22:04:43 +02:00
Robin Dupret
a023d5391e A few documentation edits [ci skip] 2015-06-15 18:16:40 +02:00
Yves Senn
863fcfa79a quick pass over changelogs. [ci skip] 2015-06-15 09:33:27 +02:00
Guillermo Iguaran
db62081235 Merge pull request #20559 from mtsmfm/fix-header-modification-by-ssl
ActionDispatch::SSL should keep original header's behavior
2015-06-14 15:10:30 -05:00
Kasper Timm Hansen
9e9cae7b37 Merge pull request #20558 from prathamesh-sonpatki/missing-header-word
Add missing "header" word in documentation of Token#authentication_request [ci skip]
2015-06-14 17:32:25 +02:00
Fumiaki MATSUSHIMA
bb0186cf55 ActionDispatch::SSL should keep original header's behavior
`ActionDispatch::SSL` changes headers to `Hash`.
So some headers will be broken if there are some middlewares
on ActionDispatch::SSL and if it uses `Rack::Utils::HeaderHash`.
2015-06-14 23:20:04 +09:00
Prathamesh Sonpatki
fe117ce776 Add missing "header" word in documentation of Token#authentication_request [ci skip] 2015-06-14 18:57:27 +05:30
Aaron Patterson
3692ca5ce7 don't hold a reference to env in the options object
I want to decouple Rails from the rack ENV as much as possible.  We
should try to keep as few references to the env as possible
2015-06-13 14:12:44 -07:00
Grey Baker
0a9b86b0c0 Handle param-parsing errors from Rack in ExceptionWrapper 2015-06-12 23:44:20 +01:00
Yves Senn
1d43458c14 Merge pull request #20480 from senny/test_runner
use our own runner for Rails framework components `bin/test`
2015-06-12 17:19:47 +02:00
Victor Costan
eb8042494f Update RDoc for ActionController::TestCase for kwargs. 2015-06-12 00:03:49 -04:00
Sean Griffin
e2dfa54db8 Merge pull request #20522 from colby-swandale/doc-update
fixed sring to be string in ActiveRecord::Base params documentation [ci skip]
2015-06-11 17:09:37 -06:00
Colby Swandale
5a1bbb2ea7 fixed sring to be string in ActiveRecord::Base params documentation 2015-06-12 06:49:26 +10:00
Santiago Pastorino
1fd42f3338 Mention that doing nothing in Rails API controllers returns 204 2015-06-11 16:54:17 -03:00
Jorge Bejar
6c16577311 Return 204 if render is not called in API controllers 2015-06-11 16:54:17 -03:00
Jorge Bejar
8d3e6e5f4d Add test coverage for implicit render in empty actions 2015-06-11 16:54:16 -03:00
Jorge Bejar
a2c9a73084 Include ParamsWrapper in AC::API
ParamsWrapper was initially removed from API controllers according to
the following discusision:
https://github.com/rails-api/rails-api/issues/33

However, we're including it again so Rails API devs can decide
whether to enable or disable it.
2015-06-11 16:54:16 -03:00
Santiago Pastorino
f3df21649a Add CHANGELOG entries for API apps functionality 2015-06-11 16:54:15 -03:00
Santiago Pastorino
7db63f3d35 Fix MimeResponds example in AC::API documentation 2015-06-11 16:54:14 -03:00
Jorge Bejar
11c71b207e Revert changes related with api apps in RouteWrapper
See the following commit to have context about this change:
757a2bc3e3
2015-06-11 16:54:14 -03:00
Jorge Bejar
08cfe34174 Rename test methods in api conditional get controller tests 2015-06-11 16:54:14 -03:00
Jorge Bejar
2487bfb39a Do not say that Api Controllers are faster than regular ones in docs 2015-06-11 16:54:14 -03:00
Jorge Bejar
fd2508522c Remove Compatibility module since we don't remember why it was added 😄 2015-06-11 16:54:14 -03:00
Jorge Bejar
674dab30bc Routes resources avoid :new and :edit endpoints if api_only is enabled 2015-06-11 16:54:14 -03:00
Santiago Pastorino
099055de66 Remove extra whitespaces 2015-06-11 16:54:13 -03:00
Santiago Pastorino
440b334cbb Use new hash syntax 2015-06-11 16:54:13 -03:00
Santiago Pastorino
b643d7a7c6 Refactor internal? to query internal_controller? and internal_asset? methods 2015-06-11 16:54:13 -03:00
Santiago Pastorino
e7b89f1081 Remove Unneeded ApiPublicExceptions middleware, PublicExceptions already does the work 2015-06-11 16:54:13 -03:00
Santiago Pastorino
38818c93a9 Remove api_rendering is not needed 2015-06-11 16:54:13 -03:00
Santiago Pastorino
4204778f8d Adhere to Rails convention for private indentation 2015-06-11 16:54:13 -03:00
Santiago Pastorino
4c1b437ed7 Use nex hash syntax on tests 2015-06-11 16:54:13 -03:00
Santiago Pastorino
3adb5eac3b Add ApiPublicException middleware 2015-06-11 16:54:10 -03:00
Santiago Pastorino
2d86b6d9ae Move Model test class inside RenderersApiController namespace 2015-06-11 16:54:09 -03:00
Santiago Pastorino
032778eefb Add ActionController API functionality 2015-06-11 16:54:09 -03:00
Zachary Scott
ed7d787e12 Merge pull request #20519 from colby-swandale/doc-update
better clarity of params source in ActionController::Base documentation
2015-06-11 13:23:15 -04:00
Yves Senn
9946788775 select the AR adapter through bin/test. 2015-06-11 14:24:56 +02:00
Yves Senn
54d84cbb77 use our runner (bin/test) for framework components.
This adds a script `bin/test` to most Rails framework components. The
script uses the rails minitest plugin to augment the runner.
See https://github.com/rails/rails/pull/19571 for details about the
plugin.

I did not yet add `bin/test` for activerecord, activejob and railties.
These components rely on specific setup performed in the rake-tasks.
2015-06-11 14:12:15 +02:00
Yuki Nishijima
a888c3cdc9 Change the index arg of ActionDispatch::Static#new to a kwarg 2015-06-11 04:34:11 -07:00
Colby Swandale
dc11b274a6 better clarity of params source in ActionController::Base documentation [ci skip] 2015-06-11 21:29:19 +10:00
Aaron Patterson
bbbe1a58e6 remove unused code 2015-06-08 17:33:45 -07:00
Aaron Patterson
877c133855 we only care about methods that the request object responds to
matches? should only deal with methods on the request object, so lets
just filter out anything that the request object doesn't respond to
2015-06-08 17:23:14 -07:00
Aaron Patterson
8037d7eacd extract required_defaults from the conditions hash before constructing the route
this way we can remove the strange "respond_to?" conditional in the
`matches?` loop
2015-06-08 17:18:32 -07:00
Mehmet Emin İNAÇ
6709891c52 Add missing documentation for ActionDispatch::Request::Session [ci skip] 2015-06-07 23:58:16 +03:00
Robin Dupret
27eccc27cb A few documentation tweaks [ci skip]
[Robin Dupret & Shunsuke Aida]
2015-06-07 14:53:24 +02:00
Vijay Dev
423f14183f Merge branch 'master' of github.com:rails/docrails 2015-06-05 19:49:44 +00:00
Aaron Patterson
6c44161834 pass check_ip and proxies to GetIp constructor
The `GetIp` class doesn't need to keep a reference to the middleware, so
there is no reason to pass the middleware instance to the `GetIp` class
2015-06-03 14:01:11 +08:00
Santiago Pastorino
4519727cdb Merge pull request #20383 from jonatack/fix-configurable-static-index-filename
Fix regression in #20017 wrong number of arguments error
2015-06-02 14:22:09 -03:00
Rafael Mendonça França
c87cce1ddf Merge pull request #20410 from schneems/schneems/boo-global-vars
Use block variable instead of global
2015-06-01 23:17:42 -03:00
schneems
e1a7260640 Use block variable instead of global
```ruby
require 'benchmark/ips'

Benchmark.ips do |x|
  x.report("$&") {
    "foo".sub(/f/) { $&.upcase }
  }
  x.report("block var") {
    "foo".sub(/f/) {|match| match.upcase }
  }
end

```

```
Calculating -------------------------------------
                  $&    48.658k i/100ms
           block var    49.666k i/100ms
-------------------------------------------------
                  $&    873.156k (± 9.3%) i/s -      4.331M
           block var    969.744k (± 9.2%) i/s -      4.818M
```

It's faster, and gets rid of a few "magic" global variables
2015-06-01 19:44:40 -05:00
Rafael Mendonça França
cf484e3ee3 Merge pull request #19094 from phoet/have_bearer_be_valid_as_well
Have Bearer be valid as well
2015-06-01 12:41:18 -03:00
phoet
4d4440c5a8 add changelog entry 2015-06-01 17:39:06 +02:00
Rafael Mendonça França
bdfc662a11 Merge pull request #20138 from tgxworld/deprecated_assert_template
Deprecate `assert_template` and `assigns()`.
2015-06-01 12:39:03 -03:00
Rafael Mendonça França
bd83caa666 Merge pull request #20284 from kaspth/fix-caching-test
Move expectation to instance level.
2015-06-01 12:38:08 -03:00
phoet
4b4e890781 allow Bearer as well as Token 2015-06-01 11:41:26 +02:00
phoet
90918b5f22 actually test what the name says 2015-06-01 11:41:26 +02:00
eileencodes
f6b01c1d06 Use any? rather than present? to check args
It's better to use Ruby methods when possible over methods defined by
Active Support because then it does not need to rely on any
dependencies.
2015-05-31 18:51:33 -04:00
Jon Atack
b7b75e0794 Fix regression in #20017: wrong number of arguments error
and use coherent quoting/spacing.

This should hopefully fix a regression that was introduced with #20017,
causing deployment pushes to Heroku to be rejected with the following
trace:

ArgumentError: wrong number of arguments (2 for 3)
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tatic.rb:16:in `initialize'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/gem
s/heroku-deflater-0.5.3/lib/heroku-deflater/serve_zipped_assets.rb:15:in
`new'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/gem
s/heroku-deflater-0.5.3/lib/heroku-deflater/serve_zipped_assets.rb:15:in
`initialize'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tack.rb:43:in `new'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tack.rb:43:in `build'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tack.rb:118:in `block in build'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tack.rb:118:in `each'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tack.rb:118:in `inject'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s
tack.rb:118:in `build'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/engine.rb:509:in `app'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/application/finisher.rb:
34:in `block in <module:Finisher>'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:30:in
`instance_exec'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:30:in
`run'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:55:in
`block in run_initializers'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:54:in
`run_initializers'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun
dler/gems/rails-0ef7e73f0af7/railties/lib/rails/application.rb:352:in
`initialize!'
remote:
/tmp/build_a3b8845b716508af12d99859d1a58c5c/config/environment.rb:5:in
`<top (required)>'
2015-05-30 22:26:13 +02:00
Kasper Timm Hansen
4abe29d813 Replace expectation with state check.
The tests would still pass if the cache call in the rendered templates were removed.
2015-05-30 18:57:10 +02:00
Mehmet Emin İNAÇ
68aafd6dd7 match method doc fix [ci skip]
match method without setting `:via` option has been deprecated

fix minor typo
2015-05-30 17:47:24 +03:00
Yoong Kang Lim
9c93b8cd07 [ci skip] match without via is now deprecated 2015-05-30 16:43:42 +10:00
Guo Xiang Tan
ca83436d1b Remove assigns and assert_template. 2015-05-30 14:13:57 +08:00
Santiago Pastorino
d9695a669b Merge pull request #20358 from tgxworld/remove_code
Remove unused code.
2015-05-29 10:39:50 -03:00
Guo Xiang Tan
4abb8c9d5b Remove unused code.
Code was moved into the `assign` method.
2015-05-29 17:41:42 +08:00
Arun Agrawal
fbe41a2477 Fix warning about ambiguous first argument 2015-05-29 07:38:45 +02:00
Rafael Mendonça França
3a8656bfd1 Merge pull request #20341 from vngrs/remove_already_defined_methods_in_rack_request
Remove already defined methods in super class of ActionDispatch::Request class
2015-05-28 22:28:21 -03:00
Rafael Mendonça França
73aab036ee Merge pull request #20017 from eliotsykes/configurable-static-index-filename
config.static_index configures directory Index "index.html" filename
2015-05-28 18:53:00 -03:00
Rafael Mendonça França
233ceda594 Merge pull request #20331 from arunagw/arunagw-remove-unused-package-tasks
Remove unused package tasks
2015-05-28 18:48:21 -03:00
Mehmet Emin İNAÇ
9a16a29f40 Remove already defined methods in super class of ActionDispatch::Request class
These methods had defined in 2004 by dhh in initial commit and `ActionDispatch::Request`
class has been inherited from `Rack::Request` class in 2009 by josh.
In 2014 these methods and more of them defined in `Rack::Request` class
so we don't need them anymore in rails codebase.
2015-05-28 20:59:21 +03:00
Mehmet Emin İNAÇ
44781b6e97 Deprecate :nothing option for render method
`head` method works similar to `render` method with `:nothing` option
2015-05-28 15:13:32 +03:00
Eliot Sykes
3ff39494cd config.static_index configures directory index "index.html" filename
Set `config.static_index` to serve a static directory index file not
named `index`. For example, to serve `main.html` instead of `index.html`
for directory requests, set `config.static_index` to `"main"`.
2015-05-28 09:41:00 +01:00
Arun Agrawal
21b6b68f63 Remove unused package tasks
We are using `all:build` now.
2015-05-28 09:06:10 +02:00
Rafael Mendonça França
902360b77f Merge pull request #20329 from EduardoBautista/json-api-support
Add application/vnd.api+json alias to the JSON MIME Type.
2015-05-27 23:55:45 -03:00
Eduardo Bautista
50b66313ad Add application/vnd.api+json alias to the JSON MIME Type. 2015-05-27 21:51:04 -05:00
Rafael Mendonça França
f02f287242 Merge pull request #19808 from byroot/action-parameter
[PoC] Stop shadowing parameters named `action`
2015-05-27 21:43:45 -03:00
Rafael Mendonça França
3e36db4406 Merge pull request #20316 from vngrs/add_assertion_for_get_method_into_request_test
Add assertion for get? method into test cases
2015-05-27 18:05:05 -03:00
Mehmet Emin İNAÇ
01d4e060e2 Add assertion for get? method into test cases 2015-05-27 15:54:56 +03:00
Mehmet Emin İNAÇ
98dd795c01 Documentation for ActionDispatch::Request form_data? method [ci skip] 2015-05-27 15:43:42 +03:00
Yves Senn
852460852c Merge pull request #20262 from arunagw/aa-remove-broken-unused-release-task
Remove broken and unused release task
2015-05-27 09:14:19 +02:00
Mehmet Emin İNAÇ
096bc4be6b Add missing nodocs and docs for ActionDispatch::Request [ci skip]
add missing dot to end of the doc
2015-05-26 19:14:04 +03:00
Mehmet Emin İNAÇ
b197a1adc5 Use memoization while accessing request headers for minimizing memory usage 2015-05-25 20:07:46 +03:00
yui-knk
5bcee8760a [ci skip] Upcase is 2015-05-25 20:36:14 +09:00
Aaron Patterson
c10630b642 remove useless ivar
I should have deleted this earlier with 42e66fac38b54dd53d062fb5d3376218ed2ffdae
2015-05-23 11:39:43 -07:00
Aaron Patterson
cf985d1a4e add a branch to eliminate multiple nil checks
if we add an else conditional to the `presence` check, we can eliminate
the second `||` branch in the caller
2015-05-23 11:38:23 -07:00
Aaron Patterson
42e66fac38 move request id manipulation to the request object
this way we can keep the knowledge of `env` hash keys in one place.
2015-05-22 16:29:16 -07:00
karanarora
0750330941 Spelling/typo/grammatical fixes [ci skip]
spelling fix [ci skip]

example to be consistent [ci skip]

grammatical fix

typo fixes [ci skip]
2015-05-23 03:01:33 +05:30
Arun Agrawal
4194d052d8 Remove broken and unused release task
- We do release with release.rb
- There is no `rake/gemcutter`
2015-05-22 14:30:30 +02:00
Arthur Nogueira Neves
c36423984d Merge pull request #17788 from sivagollapalli/master
Issue#17703 Test case for tempfile attribute
2015-05-20 22:41:19 +02:00
Rafael Mendonça França
d4cfd54308 Prefer assert_not over refute 2015-05-18 19:33:25 -03:00
Valentine Valyaeff
bad30ed46c ActionDispatch::Journey::Routes#empty? test cases 2015-05-19 01:21:20 +03:00
juggernaut-
e3333697fc Added ActionDispatch::Journey::Routes#empty? 2015-05-18 20:46:04 +03:00
Roque Pinel
bc1e80235b [ci skip] remove assigns from the integration test example in API docs
Based on #19976 and #18305.
2015-05-17 21:20:02 -04:00
Prathamesh Sonpatki
daba090dec Pass over CHANGELOGS [ci skip] 2015-05-16 11:00:17 +05:30
Yves Senn
7f60bedd7a Merge pull request #20113 from claudiob/remove-rails31-refs
[ci skip] Remove comments about Rails 3.1
2015-05-14 10:03:34 +02:00
claudiob
0080a886b2 [ci skip] Don’t encourage sudo gem install
I think we are better off leaving `sudo` outside of the documented
way of installing gems (`activerecord`, `actionpack`, …).

We don’t want newbies to think that `sudo` is required or, even worse, than
they actually have to type `[sudo] gem install`.

In most scenarios, `sudo` is not needed to install gems, and people who do
need it, probably already know about it.

What do you think? 😁
2015-05-12 14:51:19 -07:00
claudiob
271a5521e2 [ci skip] Remove comments about Rails 3.1
Stems from https://github.com/rails/rails/pull/20105#issuecomment-100900939
where @senny said:

> From my point of view, all the docs (guides, API) are version bound.
> They should describe that version and continue to be available when newer versions are released.
> The cross referencing can be done by the interested user.
2015-05-11 16:06:09 -07:00
eileencodes
16d7f6d08d Move TemplateAssertions to their own file
This moves `TemplateAssertions` out of the `test_case.rb` file and into
it's own `template_assertions` file. It still inherits from
`ActionController`.`

This is in preparation for combining the code for Integration tests and
Controller tests. This will need to be it's own file to be added to the
`requires` for Integration tests. This does not currently change ANY
behavior, just moving it for access later on.
2015-05-09 08:13:47 -04:00
Vijay Dev
9c290fbe7f Merge branch 'master' of github.com:rails/docrails 2015-05-08 16:20:27 +00:00
Anton Davydov
8a40bf2081 [skip ci] Fix typos in actionpack changelog and security guide 2015-05-07 14:49:34 +03:00
Prem Sichanugrist
7cb9e20c6c Silence ambiguous first argument warning
This silences:

    actionpack/test/journey/route_test.rb:33: warning: ambiguous first
    argument; put parentheses or a space even after `/' operator
2015-05-04 10:15:50 -04:00
Robin Dupret
a8aa8b7fc3 Tiny documentation edits [ci skip]
* Fix a few typos
* Wrap lines to 80 chars
* Use `+` instead of `<tt>`
2015-05-04 14:43:41 +02:00
Keenan Brock
ba924a514b Give authentication methods the ability to customize response message.
Digest allowed the messages.
Add the same feature to basic and token
2015-05-03 22:21:19 -04:00
Mehmet Emin İNAÇ
e4dd700b5d Use ruby 1.9 lambda syntax in documentations [ci skip] 2015-05-03 02:50:31 +03:00
eileencodes
e260975baf Use args instead of *args in kwargs_request? method
`*args` is not required here and should be avoided when not necessary
because `*args` are slower than `args` and create unnecessary array
allocations.
2015-05-02 09:31:03 -04:00
Ryan Wallace
d5a6297178 Document :tld_length option for cookies. 2015-04-29 14:15:18 -07:00
Prathamesh Sonpatki
199e277228 Updated request_forgery_protection docs [ci skip]
- Changed Javascript to JavaScript.
 - Added full-stop which was missing, also wrapped the sentence to 80 chars.
 - Changed proc to Proc and oauth to OAuth.
2015-04-28 09:52:53 +05:30
Hendy Tanata
1b61fb44e4 Add missing "of" to RequestForgeryProtection doc.
[ci skip]
2015-04-27 18:45:25 -07:00
Arthur Neves
6d9ad0dd92
Add changelog for rake routes default fix
[see #18392]
2015-04-27 09:18:43 -04:00
Arthur Nogueira Neves
86929c00c0 Merge pull request #18392 from brainopia/fix_route_requirements
Correct route requirements by overriding defaultls
2015-04-27 09:15:22 -04:00
Rafael Mendonça França
505fa60be2 Merge pull request #19904 from zzak/rm_route_wrapper_internal_hacks
Rm route wrapper internal hacks
2015-04-26 17:27:17 -03:00
Arthur Neves
757a2bc3e3
Don't reference sprockets assets on action pack
We need to ignore the `assets_prefix` when running a command like `rake
routes`. However we cannot reference asserts_prefix from action_pack as
that is a sprockets-rails concern.
See this is now implemented on sprockets-rails
85b89c44ad
2015-04-26 11:25:33 -04:00
Prathamesh Sonpatki
0ad06f2545 Removed unused code from request_forgery_protection tests 2015-04-26 18:52:37 +05:30
Zachary Scott
fc0460a32c Remove internal hacks dependent on Sprockets from RouteWrapper 2015-04-25 23:15:34 -07:00
Jorge Bejar
8c180cdaf6 Fix rake routes for api apps
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2015-04-25 23:14:28 -07:00
Guo Xiang Tan
14d7e058a0 No need to capitalize verbs. [CI SKIP] 2015-04-26 00:18:56 +08:00
Akira Matsuda
9b3fa766d4 Why do we add a top-level constant here? 2015-04-25 17:07:54 +09:00
Rafael Mendonça França
03e987cd8f Merge pull request #19879 from bboe/RedirectTestCleanup
Remove unused WorkshopsController class in redirect_test.
2015-04-23 17:25:34 -03:00
Bryce Boe
0eaae0291b Remove unused WorkshopsController class in redirect_test. 2015-04-23 16:12:01 -04:00
Rafael Mendonça França
4128e70791 Add nodoc to some private constants [ci skip] 2015-04-23 14:57:30 -03:00
Rafael Mendonça França
d949460f9b Merge pull request #19823 from sbhatore/doc_fix_1
[ci skip] Description inside Signed and Encrypted CookieJars added
2015-04-23 14:40:40 -03:00
Siddharth Bhatore
f92f5b706b Squashed commit of the following:
commit a88875ac6abaa4d8116b42af8cd71189ce3d44d3
Author: Siddharth Bhatore <sbhatore95@gmail.com>
Date:   Thu Apr 23 12:26:08 2015 +0530

    [ci skip] Update doc fix cookies

commit f175eaa7a21db898fc6c66334f770831028f9d00
Author: Siddharth Bhatore <sbhatore95@gmail.com>
Date:   Mon Apr 20 12:58:04 2015 +0530

    Description inside Signed and Encrypted CookieJars added
2015-04-23 22:56:56 +05:30
Nick Cox
4c4fa41b37 [ci skip] Add, clean up docs in ActionDispatch ActionDispatch middleware 2015-04-22 21:06:08 -07:00
Santiago Pastorino
01dad5252b Merge pull request #19852 from sbhatore/doc_fix_cookies
[ci skip] UpgradeLegacySignedCookieJar Doc fix
2015-04-22 11:51:31 -04:00
Yves Senn
cdbf685994 pass over CHANGELOGs. [ci skip] 2015-04-22 14:44:30 +02:00
Siddharth Bhatore
8f131a9ed5 [ci skip] UpgradeLegacySignedCookieJar Doc fix 2015-04-22 13:39:38 +05:30
Jean Boussier
fc9cd89de9 Allow to parameters named action or controller from AC::TestCase helpers 2015-04-18 16:08:33 -04:00
Prem Sichanugrist
3a20e83795 Add missing require for String#strip_heredoc
This method is being used in `#xml_http_request`, but was not properly
required. This causes `NoMethodError` on projects that are doing
integration test.
2015-04-17 15:21:18 -04:00
Siva Gollapalli
76d8a2a638 Issue#17703 Test case for tempfile attribute
+ To avoid regression I am adding this test case on action pack

Changed to assert from assert_equal

+ Added msg to assertion

Modified msg
2015-04-16 23:11:23 +05:30
yuuji.yaginuma
653246f3e5 remove extra = in form builder example [ci skip] 2015-04-15 23:06:01 +09:00
Arthur Nogueira Neves
7d4a1ab9ee Merge pull request #19757 from Strech/http-auth-realm-unquoting
Tiny optimization of http auth Realm unquoting
2015-04-14 17:00:32 -04:00
Rafael Mendonça França
b4a9c59a47 Fix typos in the documentation [ci skip] 2015-04-14 12:56:43 -04:00
Rafael Mendonça França
9ec54d9500 Merge pull request #19736 from kmcphillips/master
Set default form builder for a controller
2015-04-14 11:23:49 -04:00
Strech (Sergey Fedorov)
53dedfcde9 Tiny optimization of http auth Realm unquoting 2015-04-14 19:56:07 +05:00
eileencodes
db8897c2de Use silence_warnings on StaticTests
When 7e504927 was merged setting `Encoding.default_internal` and
`Encoding.default_external` would throw a warning when the ActionPack
tests were run.

Example warning: `actionpack/test/dispatch/static_test.rb:12: warning:
setting Encoding.default_external`

This patch silences the warnings as other similar tests do for setting
default_internal and default_external.
2015-04-14 08:54:13 -04:00
Guillermo Iguaran
33ea933d7b Merge pull request #19753 from jonatack/use-ruby-2-2-2
Upgrade to Ruby 2.2.2
2015-04-13 22:56:47 -05:00
Kevin McPhillips
2b8acdcd21 Override default form builder for a controller 2015-04-13 23:43:34 -04:00
Jon Atack
32f7491808 Upgrade to Ruby 2.2.2
and fix the grammar in the ruby_version_check.rb user message.
2015-04-14 08:41:56 +05:30
Zachary Scott
2778ba8ed5 Add note regarding CSRF for APIs, as a use-case for skipping it [ci skip] 2015-04-12 21:58:40 -07:00
Zachary Scott
e1ebf146b5 Apply comments from @jeremy regarding why HTML and Javascript requests
specifically are checked for CSRF, when dealing with the browser.

[ci skip]
2015-04-12 21:56:01 -07:00
Vladimir Lyzo
fd0f27ce79 update request_forgery_protection docs [ci skip] 2015-04-12 21:48:34 -07:00
Santiago Pastorino
e085a7ddb8 Revert "Merge pull request #19682 from supercaracal/fix_force_ssl_redirection_flash_error"
This reverts commit d215620340be7cb29e2aa87aab22da5ec9e6e6a7, reversing
changes made to bbbbfe1ac02162ecb5e9a7b560134a3221f129f3.
2015-04-12 22:26:35 -03:00
Taishi Kasuga
3449da4a6c fix a wrong feature test method name 2015-04-11 18:59:56 +09:00
Toshi MARUYAMA
7e50492709 [Rails4 regression] prevent thin and puma cause error in Non ASCII URL on Windows
* https://github.com/rails/rails/issues/19187
* https://github.com/rails/rails/pull/19533
* https://github.com/macournoyer/thin/issues/268

These are serious Rails 4 regression for Redmine Bitnami Windows users.

https://community.bitnami.com/t/problems-with-3-0-1-installation-see-report-inside/30195/

It is not caused on webrick users.

Related:

* https://github.com/rack/rack/issues/732#issuecomment-67677272
* https://github.com/phusion/passenger/issues/1328
2015-04-09 19:25:12 -03:00
Toshi MARUYAMA
2a73b5999e wrap "require 'drb/unix'" by bgin-end at test/abstract_unit.rb
Related: #19617, #19187, #19533, #19689, #19675.

'drb/unix' does not exist on mingw.
2015-04-09 19:25:11 -03:00
Taishi Kasuga
242c5c7ae4 fix fails to force_ssl_redirection if session_store is disabled 2015-04-09 11:21:00 +09:00
Rafael Mendonça França
8c8e9b34d5 Merge pull request #19700 from tancnle/trivial-shallow-nesting-depth-count
A shorter and more concise version of select..size
2015-04-08 20:08:06 -03:00