test/integration/categories_index_test.rb
# Assert there is category title and description.
Assert there is category title and description.
Assert there is category title and description .
def assert_category_body_for(category, present: true)
    if present
      assert_match      CGI.escapeHTML(category.title),            response.body
      assert_match      CGI.escapeHTML(category.description),      response.body
      assert_match      CGI.escapeHTML(category.posts_count.to_s), response.body
      assert_match      CGI
        .escapeHTML(time_ago_in_words(category.last_activity)),
                        response.body
    else
      assert_no_match   CGI.escapeHTML(category.title),            response.body
      assert_no_match   CGI.escapeHTML(category.description),      response.body
      assert_no_match   CGI.escapeHTML(category.posts_count.to_s), response.body
      assert_no_match   CGI
        .escapeHTML(time_ago_in_words(category.last_activity)),
                        response.body
    end
  end
def assert_category_body_for ( category , present : true ) if present assert_match CGI . escapeHTML ( category . title ) , response . body assert_match CGI . escapeHTML ( category . description ) , response . body assert_match CGI . escapeHTML ( category . posts_count . to_s ) , response . body assert_match CGI . escapeHTML ( time_ago_in_words ( category . last_activity ) ) , response . body else assert_no_match CGI . escapeHTML ( category . title ) , response . body assert_no_match CGI . escapeHTML ( category . description ) , response . body assert_no_match CGI . escapeHTML ( category . posts_count . to_s ) , response . body assert_no_match CGI . escapeHTML ( time_ago_in_words ( category . last_activity ) ) , response . body end end
Assert there is category title and description.
Assert there is category title and description .
category
<not_specific>
present
<not_specific>