Search in sources :

Example 6 with Information

use of org.mamute.model.Information in project mamute by caelum.

the class NewsController method saveEdit.

@Post
@CustomBrutauthRules(EditNewsRule.class)
public void saveEdit(@Load News news, String title, MarkedText description, String comment) {
    Information newInformation = new NewsInformation(title, description, currentUser, comment);
    news.enqueueChange(newInformation, UpdateStatus.NO_NEED_TO_APPROVE);
    result.redirectTo(this).showNews(news, news.getSluggedTitle());
}
Also used : NewsInformation(org.mamute.model.NewsInformation) Information(org.mamute.model.Information) NewsInformation(org.mamute.model.NewsInformation) CustomBrutauthRules(br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules) Post(br.com.caelum.vraptor.Post)

Example 7 with Information

use of org.mamute.model.Information in project mamute by caelum.

the class InformationDAOTest method should_find_pending_answers_edits.

@Test
public void should_find_pending_answers_edits() {
    Answer answer = answer("info1 info1 info1 info1 info1 info1 info1 ", question, author);
    session.save(answer);
    newPendingChangesAnswer(answer, 2);
    ModeratableAndPendingHistory pendingByUpdatables = informations.pendingByUpdatables(Answer.class);
    List<Information> pendingInfoForAnswer = pendingByUpdatables.pendingInfoFor(answer);
    assertEquals(2, pendingInfoForAnswer.size());
}
Also used : Answer(org.mamute.model.Answer) ModeratableAndPendingHistory(org.mamute.model.ModeratableAndPendingHistory) QuestionInformation(org.mamute.model.QuestionInformation) Information(org.mamute.model.Information) AnswerInformation(org.mamute.model.AnswerInformation) Test(org.junit.Test)

Aggregations

Information (org.mamute.model.Information)7 AnswerInformation (org.mamute.model.AnswerInformation)5 QuestionInformation (org.mamute.model.QuestionInformation)5 Test (org.junit.Test)4 Post (br.com.caelum.vraptor.Post)3 ModeratableAndPendingHistory (org.mamute.model.ModeratableAndPendingHistory)3 Question (org.mamute.model.Question)3 Answer (org.mamute.model.Answer)2 LoggedUser (org.mamute.model.LoggedUser)2 User (org.mamute.model.User)2 Moderatable (org.mamute.model.interfaces.Moderatable)2 CustomBrutauthRules (br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules)1 SimpleBrutauthRules (br.com.caelum.brutauth.auth.annotations.SimpleBrutauthRules)1 ArrayList (java.util.ArrayList)1 NewsInformation (org.mamute.model.NewsInformation)1 QuestionInformationBuilder (org.mamute.model.QuestionInformationBuilder)1 ReputationEvent (org.mamute.model.ReputationEvent)1