/test/functional/mobile_frontend/communityTopicActionsTest.php
https://github.com/kashiwasan/opCommunityTopicPlugin · PHP · 1315 lines · 1288 code · 22 blank · 5 comment · 0 complexity · ddf26e16533e20ef6f637a228081ee10 MD5 · raw file
- <?php
- ini_set('memory_limit', '256M');
- define('MOBILE_USER_AGENT', 'KDDI-CA39 UP.Browser/6.2.0.13.1.5 (FUI) MMP/2.0');
- $_SERVER['HTTP_USER_AGENT'] = MOBILE_USER_AGENT;
- function init()
- {
- include(dirname(__FILE__).'/../../bootstrap/functional.php');
- include(dirname(__FILE__).'/../../bootstrap/database.php');
- }
- function createUser($mailAddress, $user)
- {
- $params = array('authMailAddress' => array(
- 'mail_address' => $mailAddress,
- 'password' => 'password',
- ));
- $user->post('/member/login/authMode/MailAddress', $params);
- return $user;
- }
- init();
- $browser = new sfBrowser();
- $browser->setHttpHeader('User-Agent', MOBILE_USER_AGENT);
- $user = new sfTestFunctional($browser, new lime_test(612, new lime_output_color()));
- // create a test user: Mr_OpenPNE (community admin)
- //sfContext::getInstance()->getUser()->setCulture('en');
- $Mr_OpenPNE = createUser('sns@example.com', $user);
- $Mr_OpenPNE->getContext()->getUser()->setCulture('en');
- $Mr_OpenPNE
- ->info('public_flag: auth_commu_member, topic_authority: admin_only')
- ->get('/community/home/id/1')
- ->info('1. Mr. OpenPNE can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->get('/communityTopic/listCommunity/1')
- ->info('2. Mr. OpenPNE can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->get('/communityTopic/1')
- ->info('3. Mr. OpenPNE can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Mr. OpenPNE can see "編集"')
- ->checkElement('a:contains("Edit")', true)
- ->info('3-b. Mr. OpenPNE can see "コメント"')
- ->checkElement('center:contains("Comment")', true)
- ->info('3-c. Mr. OpenPNE can see "削除"')
- ->checkElement('#commentList tr td a:contains("Delete")', true)
- ->info('3-d. Mr. OpenPNE can see "コメント"')
- ->checkElement('#formTopicComment form label:contains("Comment")', true)
- ->end()
- ->click('書き込む', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->with('response')->debug()
- ->info('3-e. Mr. OpenPNE can create a new topic comment')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/1')
- ->info('4. Mr. OpenPNE can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. Mr. OpenPNE can create a new topic')
- ->click('Send', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/1')
- ->info('5. Mr. OpenPNE can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Mr. OpenPNE can edit the community topic')
- ->click('編集')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/1')
- ->info('6. Mr. OpenPNE can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Mr. OpenPNE can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/1')
- ->info('7. Mr. OpenPNE can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Mr. OpenPNE can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end()
- ->info('public_flag: public, topic_authority: admin_only')
- ->get('/community/2')
- ->info('1. Mr. OpenPNE can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Mr. OpenPNE can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Mr. OpenPNE can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/2')
- ->info('2. Mr. OpenPNE can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Mr. OpenPNE can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. Mr. OpenPNE can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Mr. OpenPNE can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/2')
- ->info('3. Mr. OpenPNE can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Mr. OpenPNE can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Mr. OpenPNE can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Mr. OpenPNE can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Mr. OpenPNE can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Mr. OpenPNE can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/2')
- ->info('4. Mr. OpenPNE can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. Mr. OpenPNE can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/2')
- ->info('5. Mr. OpenPNE can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Mr. OpenPNE can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/2')
- ->info('6. Mr. OpenPNE can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Mr. OpenPNE can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/2')
- ->info('7. Mr. OpenPNE can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Mr. OpenPNE can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end()
- ->info('public_flag: auth_commu_member, topic_authority: public')
- ->get('/community/3')
- ->info('1. Mr. OpenPNE can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Mr. OpenPNE can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Mr. OpenPNE can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/3')
- ->info('2. Mr. OpenPNE can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Mr. OpenPNE can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. Mr. OpenPNE can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Mr. OpenPNE can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/3')
- ->info('3. Mr. OpenPNE can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Mr. OpenPNE can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Mr. OpenPNE can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Mr. OpenPNE can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Mr. OpenPNE can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Mr. OpenPNE can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/3')
- ->info('4. Mr. OpenPNE can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. Mr. OpenPNE can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/3')
- ->info('5. Mr. OpenPNE can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Mr. OpenPNE can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/3')
- ->info('6. Mr. OpenPNE can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Mr. OpenPNE can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/3')
- ->info('7. Mr. OpenPNE can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Mr. OpenPNE can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end()
- ->info('public_flag: public, topic_authority: public')
- ->get('/community/4')
- ->info('1. Mr. OpenPNE can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Mr. OpenPNE can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Mr. OpenPNE can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/4')
- ->info('2. Mr. OpenPNE can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Mr. OpenPNE can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. Mr. OpenPNE can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Mr. OpenPNE can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/4')
- ->info('3. Mr. OpenPNE can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Mr. OpenPNE can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Mr. OpenPNE can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Mr. OpenPNE can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Mr. OpenPNE can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Mr. OpenPNE can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/4')
- ->info('4. Mr. OpenPNE can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. Mr. OpenPNE can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/4')
- ->info('5. Mr. OpenPNE can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Mr. OpenPNE can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/4')
- ->info('6. Mr. OpenPNE can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Mr. OpenPNE can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/4')
- ->info('7. Mr. OpenPNE can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Mr. OpenPNE can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end();
- // create a test user: tanaka (topic author)
- init();
- $tanaka = createUser('tanaka@example.com', $user);
- $tanaka
- ->info('public_flag: auth_commu_member, topic_authority: admin_only')
- ->get('/community/1')
- ->info('1. Tanaka can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Tanaka can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Tanaka cannot see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', false)
- ->end()
- ->get('/communityTopic/listCommunity/1')
- ->info('2. Tanaka can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Tanaka cannot see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', false)
- ->info('2-b. Tanaka can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Tanaka can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/1')
- ->info('3. Tanaka can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Tanaka can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Tanaka can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Tanaka can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Tanaka can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Tanaka can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/1')
- ->info('4. Tanaka cannot access communityTopic_new')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->get('/communityTopic/edit/1')
- ->info('5. Tanaka can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Tanaka can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/1')
- ->info('6. Tanaka can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Tanaka can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/1')
- ->info('7. Tanaka can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Tanaka can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end()
- ->info('public_flag: public, topic_authority: admin_only')
- ->get('/community/2')
- ->info('1. Tanaka can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Tanaka can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Tanaka cannot see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', false)
- ->end()
- ->get('/communityTopic/listCommunity/2')
- ->info('2. Tanaka can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Tanaka cannot see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', false)
- ->info('2-b. Tanaka can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Tanaka can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/2')
- ->info('3. Tanaka can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Tanaka can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Tanaka can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Tanaka can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Tanaka can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Tanaka can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/2')
- ->info('4. Tanaka cannot access communityTopic_new')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->get('/communityTopic/edit/2')
- ->info('5. Tanaka can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Tanaka can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/2')
- ->info('6. Tanaka can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Tanaka can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/2')
- ->info('7. Tanaka can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Tanaka can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end()
- ->info('public_flag: auth_commu_member, topic_authority: public')
- ->get('/community/3')
- ->info('1. Tanaka can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Tanaka can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Tanaka can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/3')
- ->info('2. Tanaka can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Tanaka can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. Tanaka can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Tanaka can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/3')
- ->info('3. Tanaka can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Tanaka can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Tanaka can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Tanaka can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Tanaka can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Tanaka can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/3')
- ->info('4. Tanaka can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. Tanaka can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/3')
- ->info('5. Tanaka can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Tanaka can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/3')
- ->info('6. Tanaka can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Tanaka can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/3')
- ->info('7. Tanaka can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Tanaka can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end()
- ->info('public_flag: public, topic_authority: public')
- ->get('/community/4')
- ->info('1. Tanaka can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. Tanaka can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. Tanaka can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/4')
- ->info('2. Tanaka can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. Tanaka can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. Tanaka can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. Tanaka can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/4')
- ->info('3. Tanaka can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. Tanaka can see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', true)
- ->info('3-b. Tanaka can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. Tanaka can see "削除"')
- ->checkElement('.commentList div:contains("削除")', true)
- ->info('3-d. Tanaka can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. Tanaka can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/4')
- ->info('4. Tanaka can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. Tanaka can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/4')
- ->info('5. Tanaka can access communityTopic_edit')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->info('5a. Tanaka can edit the community topic')
- ->click('送信')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'update')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/4')
- ->info('6. Tanaka can access communityTopicComment_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('6a. Tanaka can delete the community topic comment')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'delete')
- ->end()
- ->get('/communityTopic/deleteConfirm/4')
- ->info('7. Tanaka can access communityTopic_deleteConfirm')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('7a. Tanaka can delete the community topic')
- ->click('削除')
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'delete')
- ->end();
- // create a test user: sasaki (community member)
- init();
- $sasaki = createUser('sasaki@example.com', $user);
- $sasaki
- ->info('public_flag: auth_commu_member, topic_authority: admin_only')
- ->get('/community/1')
- ->info('1. sasaki can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. sasaki can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. sasaki cannot see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', false)
- ->end()
- ->get('/communityTopic/listCommunity/1')
- ->info('2. sasaki can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. sasaki cannot see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', false)
- ->info('2-b. sasaki can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. sasaki can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/1')
- ->info('3. sasaki can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. sasaki cannot see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', false)
- ->info('3-b. sasaki can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. sasaki cannot see "削除"')
- ->checkElement('.commentList div:contains("削除")', false)
- ->info('3-d. sasaki can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. sasaki can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/1')
- ->info('4. sasaki cannot access communityTopic_new')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->get('/communityTopic/edit/1')
- ->info('5. sasaki cannot access communityTopic_edit')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/1')
- ->info('6. sasaki cannot access communityTopicComment_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->get('/communityTopic/deleteConfirm/1')
- ->info('7. sasaki cannot access communityTopic_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('public_flag: public, topic_authority: admin_only')
- ->get('/community/2')
- ->info('1. sasaki can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. sasaki can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. sasaki cannot see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', false)
- ->end()
- ->get('/communityTopic/listCommunity/2')
- ->info('2. sasaki can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. sasaki cannot see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', false)
- ->info('2-b. sasaki can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. sasaki can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/2')
- ->info('3. sasaki can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. sasaki cannot see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', false)
- ->info('3-b. sasaki can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. sasaki cannot see "削除"')
- ->checkElement('.commentList div:contains("削除")', false)
- ->info('3-d. sasaki can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. sasaki can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/2')
- ->info('4. sasaki cannot access communityTopic_new')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->get('/communityTopic/edit/2')
- ->info('5. sasaki cannot access communityTopic_edit')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/2')
- ->info('6. sasaki cannot access communityTopicComment_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->get('/communityTopic/deleteConfirm/2')
- ->info('7. sasaki cannot access communityTopic_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('public_flag: auth_commu_member, topic_authority: public')
- ->get('/community/3')
- ->info('1. sasaki can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. sasaki can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. sasaki can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/3')
- ->info('2. sasaki can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. sasaki can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. sasaki can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. sasaki can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/3')
- ->info('3. sasaki can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. sasaki cannot see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', false)
- ->info('3-b. sasaki can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. sasaki cannot see "削除"')
- ->checkElement('.commentList div:contains("削除")', false)
- ->info('3-d. sasaki can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. sasaki can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/3')
- ->info('4. sasaki can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. sasaki can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/3')
- ->info('5. sasaki cannot access communityTopic_edit')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/3')
- ->info('6. sasaki can access communityTopicComment_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->get('/communityTopic/deleteConfirm/3')
- ->info('7. sasaki cannot access communityTopic_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->info('public_flag: public, topic_authority: public')
- ->get('/community/4')
- ->info('1. sasaki can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. sasaki can see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', true)
- ->info('1-b. sasaki can see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', true)
- ->end()
- ->get('/communityTopic/listCommunity/4')
- ->info('2. sasaki can access the community topic list')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->with('response')->begin()
- ->info('2-a. sasaki can see "トピックを作成する"')
- ->checkElement('#communityTopicList h3:contains("トピックを作成する")', true)
- ->info('2-b. sasaki can see "トピック一覧"')
- ->checkElement('.recentList h3:contains("トピック一覧")', true)
- ->info('2-c. sasaki can see two links')
- ->checkElement('.recentList dd a', true, array('count' => 2))
- ->end()
- ->get('/communityTopic/4')
- ->info('3. sasaki can access the community topic')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'show')
- ->end()
- ->with('response')->begin()
- ->info('3-a. sasaki cannot see "編集"')
- ->checkElement('.topicDetailBox .operation input[value="編集"]', false)
- ->info('3-b. sasaki can see "コメント"')
- ->checkElement('.commentList h3:contains("コメント")', true)
- ->info('3-c. sasaki cannot see "削除"')
- ->checkElement('.commentList div:contains("削除")', false)
- ->info('3-d. sasaki can see "コメントを書く"')
- ->checkElement('#formCommunityTopicComment h3:contains("コメントを書く")', true)
- ->end()
- ->info('3e. sasaki can create a new topic comment')
- ->click('送信', array('community_topic_comment' => array(
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/new/4')
- ->info('4. sasaki can access communityTopic_new')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'new')
- ->end()
- ->info('4a. sasaki can create a new topic')
- ->click('送信', array('community_topic' => array(
- 'name' => 'test',
- 'body' => 'test',
- )))
- ->isStatusCode(302)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'create')
- ->end()
- ->get('/communityTopic/edit/4')
- ->info('5. sasaki cannot access communityTopic_edit')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'edit')
- ->end()
- ->get('/communityTopic/comment/deleteConfirm/4')
- ->info('6. sasaki cannot access communityTopicComment_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopicComment')
- ->isParameter('action', 'deleteConfirm')
- ->end()
- ->get('/communityTopic/deleteConfirm/4')
- ->info('7. sasaki cannot access communityTopic_deleteConfirm')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'deleteConfirm')
- ->end();
- // create a test user: yamada (non-community member)
- init();
- $yamada = createUser('yamada@example.com', $user);
- $yamada
- ->info('public_flag: auth_commu_member, topic_authority: admin_only')
- ->get('/community/1')
- ->info('1. yamada can access the community home')
- ->isStatusCode(200)
- ->with('request')->begin()
- ->isParameter('module', 'community')
- ->isParameter('action', 'home')
- ->end()
- ->with('response')->begin()
- ->info('1-a. yamada cannot see "新着トピックリスト"')
- ->checkElement('#communityHome th:contains("新着トピックリスト")', false)
- ->info('1-b. yamada cannot see "トピックを作成する"')
- ->checkElement('#communityHome td a:contains("トピックを作成する")', false)
- ->end()
- ->get('/communityTopic/listCommunity/1')
- ->info('2. yamada cannot access the community topic list')
- ->isStatusCode(404)
- ->with('request')->begin()
- ->isParameter('module', 'communityTopic')
- ->isParameter('action', 'listCommunity')
- ->end()
- ->get('/communityTopic/1')
- ->info('3. yamada cann