Commit f01110c6 authored by jplang's avatar jplang

Removes calls to #assert_template and #assigns in functional tests.

git-svn-id: https://svn.redmine.org/redmine/trunk@15724 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent aa770fea
......@@ -9,10 +9,10 @@ wiki_content_versions_001:
wiki_content_id: 1
compression: ""
data: |-
h1. CookBook documentation
h1. CookBook documentation v1
Line from v1
Some [[documentation]] here...
wiki_content_versions_002:
updated_on: 2007-03-07 00:08:34 +01:00
......@@ -24,10 +24,10 @@ wiki_content_versions_002:
wiki_content_id: 1
compression: ""
data: |-
h1. CookBook documentation
h1. CookBook documentation v2
Line from v1
Some updated [[documentation]] here...
wiki_content_versions_003:
updated_on: 2007-03-07 00:10:51 +01:00
......@@ -39,7 +39,8 @@ wiki_content_versions_003:
wiki_content_id: 1
compression: ""
data: |-
h1. CookBook documentation
h1. CookBook documentation v3
Some updated [[documentation]] here...
wiki_content_versions_004:
data: |-
......
......@@ -161,14 +161,14 @@ class BoardsControllerTest < Redmine::ControllerTest
post :create, :project_id => 1, :board => { :name => '', :description => 'Testing board creation'}
end
assert_response :success
assert_template 'new'
assert_select_error /Name cannot be blank/
end
def test_edit
@request.session[:user_id] = 2
get :edit, :project_id => 1, :id => 2
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=?]', 'board[name]', 'Discussion'
end
def test_edit_with_parent
......@@ -176,7 +176,6 @@ class BoardsControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :edit, :project_id => 1, :id => board.id
assert_response :success
assert_template 'edit'
assert_select 'select[name=?]', 'board[parent_id]' do
assert_select 'option[value="2"][selected=selected]'
......@@ -204,7 +203,7 @@ class BoardsControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
put :update, :project_id => 1, :id => 2, :board => { :name => '', :description => 'Testing board update'}
assert_response :success
assert_template 'edit'
assert_select_error /Name cannot be blank/
end
def test_destroy
......
......@@ -28,18 +28,17 @@ class RolesControllerTest < Redmine::ControllerTest
def test_index
get :index
assert_response :success
assert_template 'index'
assert_not_nil assigns(:roles)
assert_equal Role.order('builtin, position').to_a, assigns(:roles)
assert_select 'a[href="/roles/1/edit"]', :text => 'Manager'
assert_select 'table.roles tbody' do
assert_select 'tr', Role.count
assert_select 'a[href="/roles/1/edit"]', :text => 'Manager'
end
end
def test_new
get :new
assert_response :success
assert_template 'new'
assert_select 'input[name=?]', 'role[name]'
end
def test_new_with_copy
......@@ -47,10 +46,7 @@ class RolesControllerTest < Redmine::ControllerTest
get :new, :params => {:copy => copy_from.id.to_s}
assert_response :success
assert_template 'new'
role = assigns(:role)
assert_equal copy_from.permissions, role.permissions
assert_select 'input[name=?]', 'role[name]'
assert_select 'form' do
# blank name
......@@ -76,8 +72,7 @@ class RolesControllerTest < Redmine::ControllerTest
}
}
assert_response :success
assert_template 'new'
assert_select 'div#errorExplanation'
assert_select_error /Name cannot be blank/
end
def test_create_without_workflow_copy
......@@ -113,15 +108,16 @@ class RolesControllerTest < Redmine::ControllerTest
def test_edit
get :edit, :params => {:id => 1}
assert_response :success
assert_template 'edit'
assert_equal Role.find(1), assigns(:role)
assert_select 'input[name=?][value=?]', 'role[name]', 'Manager'
assert_select 'select[name=?]', 'role[issues_visibility]'
end
def test_edit_anonymous
get :edit, :params => {:id => Role.anonymous.id}
assert_response :success
assert_template 'edit'
assert_select 'input[name=?]', 'role[name]', 0
assert_select 'select[name=?]', 'role[issues_visibility]', 0
end
......@@ -165,7 +161,7 @@ class RolesControllerTest < Redmine::ControllerTest
def test_update_with_failure
put :update, :params => {:id => 1, :role => {:name => ''}}
assert_response :success
assert_template 'edit'
assert_select_error /Name cannot be blank/
end
def test_destroy
......@@ -186,10 +182,6 @@ class RolesControllerTest < Redmine::ControllerTest
def test_get_permissions
get :permissions
assert_response :success
assert_template 'permissions'
assert_not_nil assigns(:roles)
assert_equal Role.order('builtin, position').to_a, assigns(:roles)
assert_select 'input[name=?][type=checkbox][value=add_issues][checked=checked]', 'permissions[3][]'
assert_select 'input[name=?][type=checkbox][value=delete_issues]:not([checked])', 'permissions[3][]'
......
This diff is collapsed.
......@@ -68,9 +68,9 @@ class SearchCustomFieldsVisibilityTest < Redmine::ControllerTest
assert_response :success
# we should get a result only if the custom field is visible
if fields.include?(field)
assert_equal 1, assigns(:results).size
assert_select '#search-results dt', 1
else
assert_equal 0, assigns(:results).size
assert_select '#search-results dt', 0
end
end
end
......
......@@ -34,13 +34,13 @@ class SettingsControllerTest < Redmine::ControllerTest
def test_index
get :index
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=?]', 'settings[app_title]', Setting.app_title
end
def test_get_edit
get :edit
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=""]', 'settings[enabled_scm][]'
end
......@@ -195,7 +195,7 @@ class SettingsControllerTest < Redmine::ControllerTest
get :plugin, :params => {:id => 'foo'}
assert_response :success
assert_template 'plugin'
assert_select 'form[action="/settings/plugin/foo"]' do
assert_select 'input[name=?][value=?]', 'settings[sample_setting]', 'Plugin setting value'
end
......
......@@ -37,14 +37,12 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
def test_report_at_project_level
get :report, :params => {:project_id => 'ecookbook'}
assert_response :success
assert_template 'report'
assert_select 'form#query_form[action=?]', '/projects/ecookbook/time_entries/report'
end
def test_report_all_projects
get :report
assert_response :success
assert_template 'report'
assert_select 'form#query_form[action=?]', '/time_entries/report'
end
......@@ -60,42 +58,32 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
def test_report_all_projects_one_criteria
get :report, :params => {:columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "8.65", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '8.65'
end
def test_report_all_time
get :report, :params => {:project_id => 1, :criteria => ['project', 'issue']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "162.90", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '162.90'
end
def test_report_all_time_by_day
get :report, :params => {:project_id => 1, :criteria => ['project', 'issue'], :columns => 'day'}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "162.90", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '162.90'
assert_select 'th', :text => '2007-03-12'
end
def test_report_one_criteria
get :report, :params => {:project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "8.65", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '8.65'
end
def test_report_two_criteria
get :report, :params => {:project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["user", "activity"]}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "162.90", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '162.90'
end
def test_report_custom_field_criteria_with_multiple_values_on_single_value_custom_field_should_not_fail
......@@ -123,9 +111,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
def test_report_one_day
get :report, :params => {:project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["user", "activity"]}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "4.25", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '4.25'
end
def test_report_by_week_should_use_commercial_year
......@@ -157,7 +143,6 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
def test_report_should_propose_association_custom_fields
get :report
assert_response :success
assert_template 'report'
assert_select 'select[name=?]', 'criteria[]' do
assert_select 'option[value=cf_1]', {:text => 'Database'}, 'Issue custom field not found'
......@@ -169,10 +154,8 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
def test_report_with_association_custom_fields
get :report, :params => {:criteria => ['cf_1', 'cf_3', 'cf_7']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal 3, assigns(:report).criteria.size
assert_equal "162.90", "%.2f" % assigns(:report).total_hours
assert_select 'tr.total td:last', :text => '162.90'
# Custom fields columns
assert_select 'th', :text => 'Database'
......@@ -189,15 +172,14 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
def test_report_one_criteria_no_result
get :report, :params => {:project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criteria => ['project']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
assert_equal "0.00", "%.2f" % assigns(:report).total_hours
assert_select '.nodata'
end
def test_report_status_criterion
get :report, :params => {:project_id => 1, :criteria => ['status']}
assert_response :success
assert_template 'report'
assert_select 'th', :text => 'Status'
assert_select 'td', :text => 'New'
end
......
This diff is collapsed.
......@@ -122,7 +122,9 @@ class TimelogCustomFieldsVisibilityTest < Redmine::ControllerTest
assert_select 'td', :text => 'ValueB', :count => 0
assert_select 'td', {:text => 'ValueC'}, "ValueC not found in:\n#{response.body}"
get :index, :params => {:set_filter => '1', "issue.cf_#{@field2.id}" => '*'}
assert_equal %w(ValueA ValueC), assigns(:entries).map{|i| i.issue.custom_field_value(@field2)}.sort
get :index, :params => {:set_filter => '1', "issue.cf_#{@field2.id}" => '*', :c => ["issue.cf_#{@field2.id}"]}
assert_select 'td', :text => "ValueA"
assert_select 'td', :text => "ValueC"
assert_select 'td', :text => "ValueB", :count => 0
end
end
......@@ -28,7 +28,7 @@ class TrackersControllerTest < Redmine::ControllerTest
def test_index
get :index
assert_response :success
assert_template 'index'
assert_select 'table.trackers'
end
def test_index_by_anonymous_should_redirect_to_login_form
......@@ -46,7 +46,7 @@ class TrackersControllerTest < Redmine::ControllerTest
def test_new
get :new
assert_response :success
assert_template 'new'
assert_select 'input[name=?]', 'tracker[name]'
end
def test_create
......@@ -112,7 +112,6 @@ class TrackersControllerTest < Redmine::ControllerTest
}
end
assert_response :success
assert_template 'new'
assert_select_error /name cannot be blank/i
end
......@@ -121,7 +120,6 @@ class TrackersControllerTest < Redmine::ControllerTest
get :edit, :params => {:id => 1}
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value="1"][checked=checked]', 'tracker[project_ids][]'
assert_select 'input[name=?][value="2"]:not([checked])', 'tracker[project_ids][]'
......@@ -136,7 +134,6 @@ class TrackersControllerTest < Redmine::ControllerTest
get :edit, :params => {:id => 1}
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=assigned_to_id][checked=checked]', 'tracker[core_fields][]'
assert_select 'input[name=?][value=fixed_version_id][checked=checked]', 'tracker[core_fields][]'
......@@ -186,7 +183,7 @@ class TrackersControllerTest < Redmine::ControllerTest
def test_update_with_failure
put :update, :params => {:id => 1, :tracker => { :name => '' }}
assert_response :success
assert_template 'edit'
assert_select_error /name cannot be blank/i
end
......@@ -216,7 +213,6 @@ class TrackersControllerTest < Redmine::ControllerTest
def test_get_fields
get :fields
assert_response :success
assert_template 'fields'
assert_select 'form' do
assert_select 'input[type=checkbox][name=?][value=assigned_to_id]', 'trackers[1][core_fields][]'
......
......@@ -35,37 +35,30 @@ class UsersControllerTest < Redmine::ControllerTest
def test_index
get :index
assert_response :success
assert_template 'index'
assert_not_nil assigns(:users)
# active users only
assert_nil assigns(:users).detect {|u| !u.active?}
assert_select 'table.users'
assert_select 'tr.user.active'
assert_select 'tr.user.locked', 0
end
def test_index_with_status_filter
get :index, :params => {:status => 3}
assert_response :success
assert_template 'index'
assert_not_nil assigns(:users)
assert_equal [3], assigns(:users).map(&:status).uniq
assert_select 'tr.user.active', 0
assert_select 'tr.user.locked'
end
def test_index_with_name_filter
get :index, :params => {:name => 'john'}
assert_response :success
assert_template 'index'
users = assigns(:users)
assert_not_nil users
assert_equal 1, users.size
assert_equal 'John', users.first.firstname
assert_select 'tr.user td.username', :text => 'jsmith'
assert_select 'tr.user', 1
end
def test_index_with_group_filter
get :index, :params => {:group_id => '10'}
assert_response :success
assert_template 'index'
users = assigns(:users)
assert users.any?
assert_equal([], (users - Group.find(10).users))
assert_select 'tr.user', Group.find(10).users.count
assert_select 'select[name=group_id]' do
assert_select 'option[value="10"][selected=selected]'
end
......@@ -75,8 +68,14 @@ class UsersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = nil
get :show, :params => {:id => 2}
assert_response :success
assert_template 'show'
assert_not_nil assigns(:user)
assert_select 'h2', :text => /John Smith/
end
def test_show_should_display_visible_custom_fields
@request.session[:user_id] = nil
UserCustomField.find_by_name('Phone number').update_attribute :visible, true
get :show, :params => {:id => 2}
assert_response :success
assert_select 'li', :text => /Phone number/
end
......@@ -86,8 +85,6 @@ class UsersControllerTest < Redmine::ControllerTest
UserCustomField.find_by_name('Phone number').update_attribute :visible, false
get :show, :params => {:id => 2}
assert_response :success
assert_template 'show'
assert_not_nil assigns(:user)
assert_select 'li', :text => /Phone number/, :count => 0
end
......@@ -113,7 +110,7 @@ class UsersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get :show, :params => {:id => 5}
assert_response 200
assert_not_nil assigns(:user)
assert_select 'h2', :text => /Dave2 Lopper2/
end
def test_show_user_who_is_not_visible_should_return_404
......@@ -129,10 +126,9 @@ class UsersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get :show, :params => {:id => 2}
assert_response :success
memberships = assigns(:memberships)
assert_not_nil memberships
project_ids = memberships.map(&:project_id)
assert project_ids.include?(2) #private project admin can see
# membership of private project admin can see
assert_select 'li a', :text => "OnlineStore"
end
def test_show_current_should_require_authentication
......@@ -145,15 +141,13 @@ class UsersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :show, :params => {:id => 'current'}
assert_response :success
assert_template 'show'
assert_equal User.find(2), assigns(:user)
assert_select 'h2', :text => /John Smith/
end
def test_new
get :new
assert_response :success
assert_template :new
assert assigns(:user)
assert_select 'input[name=?]', 'user[login]'
end
def test_create
......@@ -266,7 +260,7 @@ class UsersControllerTest < Redmine::ControllerTest
post :create, :params => {:user => {}}
end
assert_response :success
assert_template 'new'
assert_select_error /Email cannot be blank/
end
def test_create_with_failure_sould_preserve_preference
......@@ -283,7 +277,6 @@ class UsersControllerTest < Redmine::ControllerTest
}
end
assert_response :success
assert_template 'new'
assert_select 'select#pref_time_zone option[selected=selected]', :text => /Paris/
assert_select 'input#pref_no_self_notified[value="1"][checked=checked]'
......@@ -336,8 +329,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_edit
get :edit, :params => {:id => 2}
assert_response :success
assert_template 'edit'
assert_equal User.find(2), assigns(:user)
assert_select 'input[name=?][value=?]', 'user[login]', 'jsmith'
end
def test_edit_registered_user
......@@ -371,7 +363,7 @@ class UsersControllerTest < Redmine::ControllerTest
}
end
assert_response :success
assert_template 'edit'
assert_select_error /First name cannot be blank/
end
def test_update_with_group_ids_should_assign_groups
......@@ -476,7 +468,6 @@ class UsersControllerTest < Redmine::ControllerTest
def test_update_notified_project
get :edit, :params => {:id => 2}
assert_response :success
assert_template 'edit'
u = User.find(2)
assert_equal [1, 2, 5], u.projects.collect{|p| p.id}.sort
assert_equal [1, 2, 5], u.notified_projects_ids.sort
......
......@@ -29,12 +29,12 @@ class VersionsControllerTest < Redmine::ControllerTest
def test_index
get :index, :params => {:project_id => 1}
assert_response :success
assert_template 'index'
assert_not_nil assigns(:versions)
# Version with no date set appears
assert assigns(:versions).include?(Version.find(3))
assert_select 'h3', :text => Version.find(3).name
# Completed version doesn't appear
assert !assigns(:versions).include?(Version.find(1))
assert_select 'h3', :text => Version.find(1).name, :count => 0
# Context menu on issues
assert_select "script", :text => Regexp.new(Regexp.escape("contextMenuInit('/issues/context_menu')"))
assert_select "div#sidebar" do
......@@ -48,31 +48,33 @@ class VersionsControllerTest < Redmine::ControllerTest
def test_index_with_completed_versions
get :index, :params => {:project_id => 1, :completed => 1}
assert_response :success
assert_template 'index'
assert_not_nil assigns(:versions)
# Version with no date set appears
assert assigns(:versions).include?(Version.find(3))
assert_select 'h3', :text => Version.find(3).name
# Completed version appears
assert assigns(:versions).include?(Version.find(1))
assert_select 'h3', :text => Version.find(1).name
end
def test_index_with_tracker_ids
(1..3).each do |tracker_id|
Issue.generate! :project_id => 1, :fixed_version_id => 3, :tracker_id => tracker_id
end
get :index, :params => {:project_id => 1, :tracker_ids => [1, 3]}
assert_response :success
assert_template 'index'
assert_not_nil assigns(:issues_by_version)
assert_nil assigns(:issues_by_version).values.flatten.detect {|issue| issue.tracker_id == 2}
assert_select 'a.issue.tracker-1'
assert_select 'a.issue.tracker-2', 0
assert_select 'a.issue.tracker-3'
end
def test_index_showing_subprojects_versions
@subproject_version = Version.create!(:project => Project.find(3), :name => "Subproject version")
get :index, :params => {:project_id => 1, :with_subprojects => 1}
assert_response :success
assert_template 'index'
assert_not_nil assigns(:versions)
assert assigns(:versions).include?(Version.find(4)), "Shared version not found"
assert assigns(:versions).include?(@subproject_version), "Subproject version not found"
# Shared version
assert_select 'h3', :text => Version.find(4).name
# Subproject version
assert_select 'h3', :text => /Subproject version/
end
def test_index_should_prepend_shared_versions
......@@ -92,8 +94,6 @@ class VersionsControllerTest < Redmine::ControllerTest
def test_show
get :show, :params => {:id => 2}
assert_response :success
assert_template 'show'
assert_not_nil assigns(:version)
assert_select 'h2', :text => /1.0/
end
......@@ -127,14 +127,13 @@ class VersionsControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :new, :params => {:project_id => '1'}
assert_response :success
assert_template 'new'
assert_select 'input[name=?]', 'version[name]'
end
def test_new_from_issue_form
@request.session[:user_id] = 2
xhr :get, :new, :params => {:project_id => '1'}
assert_response :success
assert_template 'new'
assert_equal 'text/javascript', response.content_type
end
......@@ -159,7 +158,6 @@ class VersionsControllerTest < Redmine::ControllerTest
assert_equal 1, version.project_id
assert_response :success
assert_template 'create'
assert_equal 'text/javascript', response.content_type
assert_include 'test_add_version_from_issue_form', response.body
end
......@@ -170,7 +168,6 @@ class VersionsControllerTest < Redmine::ControllerTest
xhr :post, :create, :params => {:project_id => '1', :version => {:name => ''}}
end
assert_response :success
assert_template 'new'
assert_equal 'text/javascript', response.content_type
end
......@@ -178,7 +175,7 @@ class VersionsControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :edit, :params => {:id => 2}
assert_response :success
assert_template 'edit'
assert_select 'input[name=?][value=?]', 'version[name]', Version.find(2).name
end
def test_close_completed
......@@ -216,7 +213,7 @@ class VersionsControllerTest < Redmine::ControllerTest
}
}
assert_response :success
assert_template 'edit'
assert_select_error /Name cannot be blank/
end
def test_destroy
......@@ -243,15 +240,11 @@ class VersionsControllerTest < Redmine::ControllerTest
def test_issue_status_by
xhr :get, :status_by, :params => {:id => 2}
assert_response :success
assert_template 'status_by'
assert_template '_issue_counts'
end
def test_issue_status_by_status
xhr :get, :status_by, :params => {:id => 2, :status_by => 'status'}
assert_response :success
assert_template 'status_by'
assert_template '_issue_counts'
assert_include 'Assigned', response.body
assert_include 'Closed', response.body
end
......
......@@ -144,7 +144,6 @@ class WatchersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
xhr :get, :new, :params => {:project_id => 1}
assert_response :success
assert_equal Project.find(1), assigns(:project)
assert_match /ajax-modal/, response.body
end
......@@ -152,7 +151,6 @@ class WatchersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
xhr :get, :new, :params => {:project_id => 'ecookbook'}
assert_response :success
assert_equal Project.find(1), assigns(:project)
assert_match /ajax-modal/, response.body
end
......@@ -266,16 +264,16 @@ class WatchersControllerTest < Redmine::ControllerTest
def test_autocomplete_for_user_should_return_visible_users
Role.update_all :users_visibility => 'members_of_visible_projects'
hidden = User.generate!(:lastname => 'autocomplete')
visible = User.generate!(:lastname => 'autocomplete')
hidden = User.generate!(:lastname => 'autocomplete_hidden')
visible = User.generate!(:lastname => 'autocomplete_visible')
User.add_to_project(visible, Project.find(1))
@request.session[:user_id] = 2
xhr :get, :autocomplete_for_user, :params => {:q => 'autocomp', :project_id => 'ecookbook'}
assert_response :success
assert_include visible, assigns(:users)
assert_not_include hidden, assigns(:users)
assert_include visible.name, response.body
assert_not_include hidden.name, response.body
end
def test_append
......
......@@ -28,33 +28,32 @@ class WelcomeControllerTest < Redmine::ControllerTest
def test_index
get :index
assert_response :success
assert_template 'index'
assert_not_nil assigns(:news)
assert_select 'h3', :text => 'Latest news'