3 require_once(dirname(__FILE__
).'/../../../fixtures/config/config.php');
5 class Test_of_AkActionController_partials
extends AkWebTestCase
7 function test_check_if_tests_can_be_accesed()
9 $this->setMaximumRedirects(0);
10 $this->get(AK_TESTING_URL
.'/render_tests');
12 $this->assertResponse(200);
13 $this->assertTextMatch('RenderTestsController is available on tests');
16 function test_render_partial()
18 $this->get(AK_TESTING_URL
.'/render_tests/hello_partial');
19 $this->assertTextMatch('Hello World From Partial');
22 function test_render_partial_inside_template()
24 $this->get(AK_TESTING_URL
.'/advertiser/partial_in_template');
25 $this->assertTextMatch('Big CorpBig Corp');
28 function test_render_partial_with_options()
30 $this->get(AK_TESTING_URL
.'/render_tests/hello_partial_with_options');
31 $this->assertTextMatch('Hello Cruel World From Partial');
34 function test_render_partial_doc_example()
36 $this->get(AK_TESTING_URL
.'/advertiser/buy');
37 $this->assertTextMatch('Akelos MediaFirst adSeccond ad');
40 function test_render_partial_collection_doc_example()
42 $this->get(AK_TESTING_URL
.'/advertiser/all');
43 $this->assertTextMatch('1First ad2Seccond ad');
45 function test_render_partial_collection_from_controller()
47 $this->get(AK_TESTING_URL
.'/advertiser/show_all');
48 $this->assertTextMatch('1First ad2Seccond ad');
51 function test_render_partial_from_different_controller()
53 $this->get(AK_TESTING_URL
.'/render_tests/shared_partial');
54 $this->assertTextMatch('First ad');
57 function test_render_partial_from_different_template()
59 $this->get(AK_TESTING_URL
.'/render_tests/ad');
60 $this->assertTextMatch('First ad');
64 ak_test('Test_of_AkActionController_partials');