import java.util.HashMap;
import java.util.Locale;
+import org.hamcrest.CoreMatchers;
import org.junit.Test;
import club.wpia.gigi.GigiApiException;
import club.wpia.gigi.localisation.Language;
import club.wpia.gigi.pages.account.MyDetails;
import club.wpia.gigi.pages.admin.support.SupportUserDetailsPage;
+import club.wpia.gigi.testUtils.ArrayContains;
import club.wpia.gigi.testUtils.IOUtils;
import club.wpia.gigi.testUtils.SEClientTest;
import club.wpia.gigi.testUtils.TestEmailReceiver.TestMail;
getMailReceiver().receive(targetEmail);
TestMail tm = getMailReceiver().receive(ServerConstants.getSupportMailAddress());
assertThat(tm.getMessage(), containsString("A password reset was triggered and an email was sent to user."));
+
+ User test = User.getById(targetID);
+ String[] result = test.getAdminLog();
+ assertThat(result, ArrayContains.contains(CoreMatchers.equalTo("SE triggered password reset (a20140808.8)")));
}
@Test
// supporter removes supporter flag
URLConnection uc = post(SupportUserDetailsPage.PATH + u.getId() + "/", "removeGroup&groupToModify=" + URLEncoder.encode(Group.SUPPORTER.getDBName(), "UTF-8"));
- assertEquals("https://" + ServerConstants.getHostNamePortSecure(Host.WWW) + MyDetails.PATH, uc.getHeaderField("Location"));
+ assertEquals("https://" + ServerConstants.getHostNamePortSecure(Host.SECURE) + MyDetails.PATH, uc.getHeaderField("Location"));
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
Group.SUPPORTER.getName().output(pw, Language.getInstance(Locale.ENGLISH), new HashMap<String, Object>());