Commit Graph

5571 Commits

Author SHA1 Message Date
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
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
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
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
Guo Xiang Tan
ca83436d1b Remove assigns and assert_template. 2015-05-30 14:13:57 +08:00
Arun Agrawal
fbe41a2477 Fix warning about ambiguous first argument 2015-05-29 07:38:45 +02: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
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
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
Mehmet Emin İNAÇ
01d4e060e2 Add assertion for get? method into test cases 2015-05-27 15:54:56 +03: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
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
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
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
Prathamesh Sonpatki
0ad06f2545 Removed unused code from request_forgery_protection tests 2015-04-26 18:52:37 +05:30
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
Akira Matsuda
9b3fa766d4 Why do we add a top-level constant here? 2015-04-25 17:07:54 +09:00
Bryce Boe
0eaae0291b Remove unused WorkshopsController class in redirect_test. 2015-04-23 16:12:01 -04:00
Jean Boussier
fc9cd89de9 Allow to parameters named action or controller from AC::TestCase helpers 2015-04-18 16:08:33 -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
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
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
Kevin McPhillips
2b8acdcd21 Override default form builder for a controller 2015-04-13 23:43:34 -04: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
041c2c879a Merge pull request #19633 from y00rb/sort_router_parameters_duplicated_keys
avoid error when sort mixture keys in symbol and string
2015-04-08 19:01:11 -03:00
Yang Bo
a77de09812 sort_by instead of sort
it is avoid sort errot within different and mixed keys.
used `sort_by` + `block` to list parameter by keys.
keep minimum changes
2015-04-08 22:18:56 +08:00
eileencodes
188934cdac Fix ActionPack tests after changes to missing template logger
After merging #19377 ActionPack tests were missing a require for
`ActiveSupport::LogSubscriber::TestHelper` and change didn't take
into account that logger could be nil. Added the require and only log to
info if logger exists.

This wasn't caught earlier because these tests only run after a merge.
2015-04-06 09:03:13 -04:00
Stephen Bussey
0de4a23d1c head no_content when there is no template or action performed 2015-04-05 15:46:50 -04:00
Xavier Noria
8798788c65 Merge pull request #19544 from shuhei/fix-parameters-const-missing
Return super in ActionController::Parameters.const_missing
2015-03-28 10:01:25 +01:00
Shuhei Kagawa
1b0526eaac Return super in ActionController::Parameters.const_missing
The current implementation of ActionController::Parameters.const_missing
returns `ActionController::Parameters.always_permitted_parameters` even
if its `super` returns a constant without raising error. This prevents its
subclass in a autoloading module/class from taking advantage of
autoloading constants.

    class SomeParameters < ActionController::Parameters
      def do_something
        DefinedSomewhere.do_something
      end
    end

In the code above, `DefinedSomewhere` is to be autoloaded with
`Module.const_missing` but `ActionController::Parameters.const_missing`
returns `always_permitted_parameters` instead of the autoloaded
constant.

This pull request fixes the issue respecting `const_missing`'s `super`.
2015-03-28 10:40:58 +09:00
Rafael Mendonça França
9c3c07b325 Define a setup method instead of using setup as block
setup as block run before setup actlually runs so it will fail for our
case
2015-03-27 16:29:15 -03:00
George Claghorn
9d9cc4777b Provide friendlier access to request variants
Closes #18933.
2015-03-24 12:49:27 -05:00
Andrew White
550c1f0950 Fix failing tests for #19474 2015-03-23 13:15:59 +00:00
Gaurav Sharma
29efc6ee05 remove old unavailable link with relevant fix 2015-03-23 11:18:14 +05:30
adam
b49cac80de Fix handling of empty X_FORWARDED_HOST header.
Previously, an empty X_FORWARDED_HOST header would cause
Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
Actiondispatch::Http:URL.host to raise a NoMethodError.
2015-03-20 20:32:30 +00:00
Jeremy Kemper
5154089c18 Revert "Merge pull request #19404 from dmathieu/remove_rack_env"
Preserving RACK_ENV behavior.

This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
2015-03-20 08:14:11 -07:00
eileencodes
adae55f476 Fix kwargs warning in test_get_xml
ActionDispatch::IntegrationTest HTTP request methods will accept only
certain kwargs in the future. This test caused a deprecation warning
when running ActionPack tests. Added `params` and `headers` to fix.
2015-03-20 08:48:10 -04:00
Akshay Vishnoi
c27b2df561 Fix test messages use directly true, false and nil instead of their symbol 2015-03-19 23:47:58 +05:30
Damien Mathieu
d578cbfb5c don't fallback to RACK_ENV when RAILS_ENV is not present 2015-03-19 10:06:28 +01:00