summaryrefslogtreecommitdiffstats
path: root/test/unit/news_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/news_test.rb')
-rw-r--r--test/unit/news_test.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/unit/news_test.rb b/test/unit/news_test.rb
index e9d3880e5..b1b608dfc 100644
--- a/test/unit/news_test.rb
+++ b/test/unit/news_test.rb
@@ -46,9 +46,8 @@ class NewsTest < ActiveSupport::TestCase
end
def test_should_not_include_news_for_projects_with_news_disabled
- # The projects_002 (OnlineStore) doesn't have the news module enabled, use that project for this test
- project = projects(:projects_002)
- assert ! project.enabled_modules.any?{ |em| em.name == 'news' }
+ EnabledModule.delete_all(["project_id = ? AND name = ?", 2, 'news'])
+ project = Project.find(2)
# Add a piece of news to the project
news = project.news.create(valid_news)
@@ -58,8 +57,7 @@ class NewsTest < ActiveSupport::TestCase
end
def test_should_only_include_news_from_projects_visibly_to_the_user
- # users_001 has no memberships so can only get news from public project
- assert News.latest(users(:users_001)).all? { |news| news.project.is_public? }
+ assert News.latest(User.anonymous).all? { |news| news.project.is_public? }
end
def test_should_limit_the_amount_of_returned_news