Class: Zena::Controller::TestCase
- Inherits:
-
ActionController::TestCase
- Object
- ActionController::TestCase
- Zena::Controller::TestCase
- Includes:
- Authlogic::TestCase, Acts::Secure, Use::Fixtures, Use::TestHelper
- Defined in:
- lib/zena/controller/test_case.rb
Constant Summary
Constants included from Use::Fixtures
Use::Fixtures::FILE_FIXTURES_PATH, Use::Fixtures::FIXTURE_PATH
Instance Method Summary collapse
- #assert_match(match, target) ⇒ Object
- #assert_no_match(match, target) ⇒ Object
- #login(fixture, site_name = nil) ⇒ Object
- #setup ⇒ Object
Methods included from Acts::Secure
#secure_scope, #secure_write_scope, #visitor=
Methods included from Acts::Secure::SecureResult
#construct_id_map, #secure_result
Methods included from Use::TestHelper
#err, #execute_after_commit!, #file_path, #preserving_files, #set_date, #uploaded_archive, #uploaded_fixture, #uploaded_jpg, #uploaded_pdf, #uploaded_png, #uploaded_text, #uploaded_zip, #with_caching, #without_files
Methods included from Use::Fixtures
dest_filepath, included, #load_fixtures, load_fixtures, reset_data_folder, reset_public_folder, #test_site
Instance Method Details
#assert_match(match, target) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/zena/controller/test_case.rb', line 37 def assert_match(match, target) return super if match.kind_of?(Regexp) target = Hpricot(target) assert !target.search(match).empty?, "expected tag, but no tag found matching #{match.inspect} in:\n#{target.inspect}" end |
#assert_no_match(match, target) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/zena/controller/test_case.rb', line 44 def assert_no_match(match, target) return super if match.kind_of?(Regexp) target = Hpricot(target) assert target.search(match).empty?, "expected not tag, but tag found matching #{match.inspect} in:\n#{target.inspect}" end |
#login(fixture, site_name = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zena/controller/test_case.rb', line 13 def login(fixture, site_name = nil) super if defined?(@controller) @controller.class_eval do def set_visitor # do nothing end end end end |
#setup ⇒ Object
9 10 11 |
# File 'lib/zena/controller/test_case.rb', line 9 def setup activate_authlogic end |