Commit Graph

149 Commits

Author SHA1 Message Date
Vishnu Atrai
525fd3ac86 TODO fix explicitly loading exceptations, autoload removed 2011-07-11 13:14:02 +05:30
David Chelimsky
a7af1e0051 Get the fixture_path from self.class instead of ActiveSupport::TestCase.
This allows test classes that are not subclasses of
ActiveSupport::TestCase (like those in rspec-rails) to interact with
with this variable without having to reference ActiveSupport::TestCase.
2011-06-25 13:59:49 -05:00
Santiago Pastorino
1d3618a9b4 remove warning: assigned but unused variable 2011-06-08 00:26:09 -03:00
Andrew White
e864ff7259 Add backward compatibility for testing cookies
This commit restores the ability to assign cookies for testing via
@request.env['HTTP_COOKIE'] and @request.cookies, e.g:

    @request.env['HTTP_COOKIE'] = 'user_name=david'
    get :index
    assert_equal 'david', cookies[:user_name]

and

    @request.cookies[:user_name] = 'david'
    get :index
    assert_equal 'david', cookies[:user_name]

Assigning via cookies[] is the preferred method and will take precedence
over the other two methods. This is so that cookies set in controller
actions have precedence and are carried over between calls to get, post, etc.
2011-06-05 12:34:27 +01:00
Andrew White
a50865c7dc Add missing require for cookies middleware 2011-06-04 09:35:48 +01:00
Andrew White
d4658d86fe Refactor ActionController::TestCase cookies
Assigning cookies for test cases should now use cookies[], e.g:

  cookies[:email] = 'user@example.com'
  get :index
  assert_equal 'user@example.com', cookies[:email]

To clear the cookies, use clear, e.g:

  cookies.clear
  get :index
  assert_nil cookies[:email]

We now no longer write out HTTP_COOKIE and the cookie jar is
persistent between requests so if you need to manipulate the environment
for your test you need to do it before the cookie jar is created.
2011-06-04 07:09:11 +01:00
Lee Reilly
4f234bfd79 Corrected some typos and American vs. Queen's English issues 2011-05-29 12:40:24 -07:00
Xavier Noria
00e1d0832e Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionmailer/lib/action_mailer/base.rb
	activesupport/lib/active_support/core_ext/kernel/requires.rb
2011-05-25 22:48:47 +02:00
Sebastian Martinez
fcdb5dc557 Remove extra white spaces on ActionPack docs. 2011-05-23 20:22:33 -03:00
wycats
ddc584e89e Restructure TemplateAssertions-related code to eliminate circular requires.
Also, no need to include dependencies in AS::Concerns inside included blocks.
2011-05-22 23:13:44 -07:00
Jeremy Kemper
b77e032ccf Merge pull request #247 from goncalossilva/performance_test
Performance tests improved
2011-05-17 14:28:40 -07:00
Xavier Noria
d491130236 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/date_helper.rb
	railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
2011-05-14 11:21:27 +02:00
Jason Dew
6b07d7f9da typo 2011-05-13 17:15:29 -07:00
Sebastian Martinez
ab880b9eb0 Follow code conventions on docs 2011-05-10 20:55:31 -03:00
Gonçalo Silva
aec7456f81 Merge branch 'master' of https://github.com/rails/rails into performance_test
Conflicts:
	activesupport/lib/active_support/testing/performance.rb
2011-05-08 03:54:55 +01:00
David Heinemeier Hansson
b29a905f94 Flunk makes a lot more sense, doesnt it (hat tip @tenderlove) 2011-05-02 17:04:21 -05:00
David Heinemeier Hansson
89f315bfb2 We cant use assert_block because its buggy in MiniTest and wont actually show you the failure message you provide -- instead you just always get a "Expected block to return true" 2011-04-22 19:38:01 +02:00
Gonçalo Silva
1c2b2233c3 Merge branch 'master' of https://github.com/rails/rails into performance_test 2011-04-17 17:08:49 +01:00
Prem Sichanugrist
733bfa63f5 Remove #among? from Active Support
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.

It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
2011-04-13 20:25:28 +08:00
Xavier Noria
acdbc6ae41 renames response_from_page_or_rjs -> response_from_page, and extracts the RJS in it 2011-04-13 13:24:33 +02:00
Xavier Noria
b878757c50 removes assert_select_rjs 2011-04-13 13:23:16 +02:00
David Heinemeier Hansson
d1575ae1b9 Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion! 2011-04-12 00:23:07 +02:00
Prem Sichanugrist
a9f3c9da01 Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
2011-04-11 03:17:09 +08:00
Santiago Pastorino
0e4748cd41 Make process reuse the env var passed as argument 2011-04-06 16:37:55 -03:00
Xavier Noria
3e24e9ebc2 Merge branch 'master' of git://github.com/lifo/docrails 2011-04-03 22:22:03 +02:00
Gonçalo Silva
5b2b513742 Merge branch 'master' of https://github.com/rails/rails into performance_test 2011-04-03 02:02:35 +01:00
Aaron Patterson
58c3ec1b7b use assert_equal so we get normal error messages along with our custom failure message 2011-03-30 15:29:52 -07:00
John Firebaugh
07054fe369 Fix grammar, formatting, and cross references 2011-03-28 22:17:20 -07:00
Gonçalo Silva
1a9b1edb49 remove deprecated documentation 2011-03-28 00:32:00 +01:00
Gonçalo Silva
a6e22229b9 move "check for ruby-prof" from AD/testing/performance_test to AS/testing/performance, where it is actually required 2011-03-24 23:57:57 +00:00
Andrew White
31f09f9dbc Improve testing of cookies in functional tests:
- cookies can be set using string or symbol keys
- cookies are preserved across calls to get, post, etc.
- cookie names and values are escaped
- cookies can be cleared using @request.cookies.clear

[#6272 state:resolved]
2011-03-06 12:49:44 +00:00
Andrew White
af4fab7d2e Remove incorrect assert_recognizes example 2011-02-13 23:25:57 +00:00
Andrew White
385be358cf Fix assert_recognizes with block constraints [#5805 state:resolved] 2011-02-13 23:24:46 +00:00
misfo
ef48408a7b corrected the location of status code symbols 2011-01-29 16:03:40 -06:00
Aaron Patterson
831a2342c6 just use alias 2010-11-30 20:04:31 -08:00
José Valim
da583df50c Remove bazillion warnings from AP suite. 2010-11-23 10:09:24 +01:00
Sven Fuchs
5c86286dd6 add respond_to? to ActionDispatch::Integration::Runner
since Runner uses method_missing to delegate to the integration session it also should define respond_to? accordingly
2010-11-22 15:42:28 -08:00
David Trasbo
990f52ebd7 Make cookies hash in ActionDispatch::TestProcess indifferent access [#5761 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-07 14:48:51 -02:00
Santiago Pastorino
d3d724bb88 Remove this require since active_support/testing/default doesn't exist anymore 2010-10-20 12:50:31 -02:00
Aaron Patterson
ff2fdcc52b removing AS::Testing::Default in favor of just undefing default_test 2010-10-01 17:22:42 -07:00
Emilio Tagua
c37800aae1 _ is not a valid scheme name character, \w includes it and also is redundant with \d.
'The scheme name consists of a letter followed by any combination of letters, digits, and the plus ("+"), period ("."), or hyphen ("-") characters; and is terminated by a colon (":").'
2010-09-29 12:55:43 -03:00
Emilio Tagua
8823b85010 Remove redundant conditional. 2010-09-29 12:42:51 -03:00
José Valim
b1ae796284 Fix an error on 1.8.7. 2010-09-29 11:28:38 +02:00
José Valim
14f9904e0f Avoid (@_var ||= nil) pattern by using initialize methods and ensuring everyone calls super as expected. 2010-09-29 11:18:31 +02:00
Emilio Tagua
523f98099d Remove more warnings on AP. 2010-09-28 18:01:48 -03:00
Emilio Tagua
059d609a1a Avoid more uninitialized variable warnings. 2010-09-28 15:46:30 -03:00
Emilio Tagua
adcc5e11fe @selected may not be defined here, avoid warning. 2010-09-28 15:29:40 -03:00
Emilio Tagua
b8c565fbd6 Initialize @app if it doesn't exists. 2010-09-28 15:10:15 -03:00
Emilio Tagua
1ab2ab07b5 Remove more warnings shadowing outer local variable.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-27 16:43:17 -03:00
Emilio Tagua
50decfbc0e _routes must be inside @controller conditional. 2010-09-27 11:19:24 -03:00