[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [websites/sso-kde-org] app/tests/steps: Search test cases
From:       Sayak Banerjee <sayakb () kde ! org>
Date:       2014-10-26 7:49:31
Message-ID: E1XiIZv-00046K-Ur () scm ! kde ! org
[Download RAW message or body]

Git commit f1a649c52027c900a4fd681c61e46c9af38dbb56 by Sayak Banerjee.
Committed on 26/10/2014 at 07:49.
Pushed by sayakb into branch 'master'.

Search test cases

M  +72   -1    app/tests/steps/GroupTest.php

http://commits.kde.org/websites/sso-kde-org/f1a649c52027c900a4fd681c61e46c9af38dbb56

diff --git a/app/tests/steps/GroupTest.php b/app/tests/steps/GroupTest.php
index 2f1128b..44e5c82 100755
--- a/app/tests/steps/GroupTest.php
+++ b/app/tests/steps/GroupTest.php
@@ -542,7 +542,7 @@ class GroupTest extends KeychainTestCase {
 	}
 
 	/**
-	 * Tests the getAddUser method of the controller when user does not
+	 * Tests the getPermissions method of the controller when user does not
 	 * have permissions
 	 *
 	 * @access public
@@ -558,4 +558,75 @@ class GroupTest extends KeychainTestCase {
 		$this->call('GET', "group/permissions/{$group->hash}");
 	}
 
+	/**
+	 * Tests the getDelete method of the controller
+	 *
+	 * @access public
+	 * @return void
+	 */
+	public function testGetDelete()
+	{
+		$admin = TestHelper::createUser(UserStatus::ACTIVE, true)->user;
+		$group = TestHelper::createGroup(GroupTypes::CLOSED)->group;
+
+		$this->be($admin);
+		$this->call('GET', "group/delete/{$group->hash}");
+
+		$this->assertRedirectedTo('group/list');
+		$this->assertSessionHas('messages.success');
+		$this->assertEquals(null, Group::find($group->id));
+	}
+
+	/**
+	 * Tests the getDelete method of the controller when the user
+	 * does not have access
+	 *
+	 * @access public
+	 * @return void
+	 * @expectedException \Symfony\Component\HttpKernel\Exception\HttpException
+	 */
+	public function testGetDeleteNoPermissions()
+	{
+		$user = TestHelper::createUser(UserStatus::ACTIVE)->user;
+		$group = TestHelper::createGroup(GroupTypes::CLOSED)->group;
+
+		$this->be($user);
+		$this->call('GET', "group/delete/{$group->hash}");
+	}
+
+	/**
+	 * Tests the getSearch method of the controller
+	 *
+	 * @access public
+	 * @return void
+	 */
+	public function testGetSearch()
+	{
+		$user = TestHelper::createUser(UserStatus::ACTIVE)->user;
+
+		$this->be($user);
+		$this->call('GET', 'group/search', array('query' => 'Registered Users'), array(), \
array('HTTP_X-Requested-With' => 'XMLHttpRequest')); +
+		$this->assertResponseOk();
+		$this->assertViewHas('items');
+	}
+
+	/**
+	 * Tests the getMemberSearch method of the controller
+	 *
+	 * @access public
+	 * @return void
+	 */
+	public function testGetMemberSearch()
+	{
+		$user = TestHelper::createUser(UserStatus::ACTIVE)->user;
+		$group = TestHelper::createGroup(GroupTypes::OPEN, $user)->group;
+
+		$this->be($user);
+		$this->call('GET', "group/member-search/{$group->hash}", array('query' => 'Unit \
Test'), array(), array('HTTP_X-Requested-With' => 'XMLHttpRequest')); +
+		$this->assertResponseOk();
+		$this->assertViewHas('users');
+	}
+
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic