test/integration/posts_index_aka_topic_show_test.rb
# No mather what this layout should apply.
No mather what this layout should apply.
No mather what this layout should apply .
def assert_basic_layout
    get topic_path(@topic)
    assert_template 'posts/index'
    assert_match CGI.escapeHTML(@topic.title), response.body
    current_page = assigns(:posts).current_page
    total_pages = assigns(:posts).total_pages
    assert_match CGI.escapeHTML("#{current_page}/#{total_pages}"), response.body
    assert_select 'a[href=?]', category_path(@topic.category)
    assert_select 'ul.pagination', count: 1
    assert_flash_notices
  end
def assert_basic_layout get topic_path ( @topic ) assert_template 'posts/index' assert_match CGI . escapeHTML ( @topic . title ) , response . body current_page = assigns ( :posts ) . current_page total_pages = assigns ( :posts ) . total_pages assert_match CGI . escapeHTML ( "#{current_page}/#{total_pages}" ) , response . body assert_select 'a[href=?]' , category_path ( @topic . category ) assert_select 'ul.pagination' , count : 1 assert_flash_notices end
No mather what this layout should apply.
No mather what this layout should apply .
# Posts index is actually topic show. # Assert there is topic title. # Assert there is current_page/total_pages indicator. # Asset there is link to corresponding category. # Assert there is will_paginate  on the page. # Assert there is no flash messages.