Check that regular users can't add aliases.

This commit is contained in:
jgen 2014-02-19 17:03:35 -05:00
parent 1a7cbc9b2a
commit 5a49bb59e4

View file

@ -4,6 +4,13 @@ class AliasEditorTest extends ShimmieWebTestCase {
$this->get_page('alias/list'); $this->get_page('alias/list');
$this->assert_title("Alias List"); $this->assert_title("Alias List");
// Check that normal users can't add aliases.
$this->log_in_as_user();
$this->get_page('alias/list');
$this->assert_title("Alias List");
$this->assertFalse($this->assertFieldByName('oldtag', ''));
$this->log_out();
$this->log_in_as_admin(); $this->log_in_as_admin();
# test one to one # test one to one
@ -11,8 +18,8 @@ class AliasEditorTest extends ShimmieWebTestCase {
$this->assert_title("Alias List"); $this->assert_title("Alias List");
$this->set_field('oldtag', "test1"); $this->set_field('oldtag', "test1");
$this->set_field('newtag', "test2"); $this->set_field('newtag', "test2");
$this->clickSubmit("Add"); $this->click("Add");
$this->assertResponse(302); //$this->assertResponse(302);
$this->get_page('alias/list'); $this->get_page('alias/list');
if (!$this->assert_text("test1")) { if (!$this->assert_text("test1")) {