3 class IssuesTest < Capybara::Rails::TestCase
4 def test_view_issues_normal_user
5 sign_in_as(create(:user))
8 assert page.has_content?(I18n.t("application.require_admin.not_an_admin"))
11 def test_view_no_issues
12 sign_in_as(create(:moderator_user))
15 assert page.has_content?(I18n.t(".issues.index.search.issues_not_found"))
19 sign_in_as(create(:moderator_user))
20 issues = create_list(:issue, 3, :issue_type => "moderator")
23 assert page.has_content?(issues.first.reported_user.display_name)
27 issue = create(:issue)
28 sign_in_as(create(:moderator_user))
30 visit issue_path(issue)
32 fill_in :issue_comment_body, :with => "test comment"
34 assert page.has_content?(I18n.t(".issues.comment.comment_created"))
35 assert page.has_content?("test comment")
38 assert_equal issue.comments.first.body, "test comment"