use of org.mamute.model.LoggedUser in project mamute by caelum.
the class ForgotPasswordTest method should_loggin_automatically_after_reseted_password_user.
@Test
public void should_loggin_automatically_after_reseted_password_user() {
VRaptorTestResult newPassword = resetPassword();
LoggedUser logged = newPassword.getObject("currentUser");
assertEquals(user.getEmail(), logged.getCurrent().getEmail());
}
use of org.mamute.model.LoggedUser in project mamute by caelum.
the class ForgotPasswordTest method should_loggin_for_reseted_password_user.
@Test
public void should_loggin_for_reseted_password_user() {
resetPassword();
UserFlow navigation3 = loginWithPassword(navigate(), user.getEmail(), password);
VRaptorTestResult loginResult = navigation3.followRedirect().execute();
loginResult.wasStatus(200).isValid();
LoggedUser loggedUser = loginResult.getObject("currentUser");
assertEquals(user.getEmail(), loggedUser.getCurrent().getEmail());
}
use of org.mamute.model.LoggedUser in project mamute by caelum.
the class DaoManager method answerQuestion.
public Answer answerQuestion(User author, Question question, String description, boolean watching) {
this.session.beginTransaction();
LoggedUser loggedUser = new LoggedUser(author, null);
AnswerInformation information = new AnswerInformation(notMarked(description), loggedUser, "new answer");
Answer answer = new Answer(information, question, author);
this.answerDao.save(answer);
this.session.getTransaction().commit();
return answer;
}
use of org.mamute.model.LoggedUser in project mamute by caelum.
the class ReputationEventDAOTest method setup.
@Before
public void setup() {
reputationEvents = new ReputationEventDAO(session, new InvisibleForUsersRule(new LoggedUser(author, null)));
author = user("Brutal User", "brutal@brutal.com");
tag = tag("java");
questionInvolved1 = question(author, tag);
questionInvolved2 = question(author, tag);
questionInvolved3 = question(author, tag);
session.save(author);
session.save(tag);
session.save(questionInvolved1);
session.save(questionInvolved2);
session.save(questionInvolved3);
}
use of org.mamute.model.LoggedUser in project mamute by caelum.
the class WithUserPaginatedDAOTest method setup.
@Before
public void setup() {
session.save(author);
session.save(upVote);
session.save(upVote2);
session.save(upVote3);
session.save(defaultTag);
InvisibleForUsersRule invisibleFilter = new InvisibleForUsersRule(new LoggedUser(author, null));
questionsWithUser = new WithUserPaginatedDAO<Question>(session, Question.class, UserRole.AUTHOR, invisibleFilter);
answersWithUser = new WithUserPaginatedDAO<Answer>(session, Answer.class, UserRole.AUTHOR, invisibleFilter);
}
Aggregations