Search in sources :

Example 11 with News

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

the class NewsTest method not_approved_news_should_be_visible_to_author.

@Test
public void not_approved_news_should_be_visible_to_author() {
    News news = news("news title", "news description", author);
    assertTrue(news.checkVisibilityFor(loggedUser(author)));
}
Also used : News(org.mamute.model.News) Test(org.junit.Test)

Example 12 with News

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

the class NewsTest method not_approved_news_should_not_be_visible_to_regular_user.

@Test(expected = NotFoundException.class)
public void not_approved_news_should_not_be_visible_to_regular_user() {
    News news = news("news title", "news description", author);
    news.checkVisibilityFor(loggedUser(regularUser));
}
Also used : News(org.mamute.model.News) Test(org.junit.Test)

Aggregations

News (org.mamute.model.News)12 Test (org.junit.Test)7 LoggedUser (org.mamute.model.LoggedUser)3 NewsInformation (org.mamute.model.NewsInformation)3 User (org.mamute.model.User)3 DateTime (org.joda.time.DateTime)2 NewsBuilder (org.mamute.builder.NewsBuilder)2 Question (org.mamute.model.Question)2 CustomBrutauthRules (br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules)1 Get (br.com.caelum.vraptor.Get)1 Post (br.com.caelum.vraptor.Post)1 Email (org.apache.commons.mail.Email)1 QuestionBuilder (org.mamute.builder.QuestionBuilder)1 ReputationEventContext (org.mamute.model.ReputationEventContext)1 LinkToHelper (org.mamute.notification.NotificationMailer.LinkToHelper)1