summaryrefslogtreecommitdiffstats
path: root/test/functional/activities_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-18 21:26:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-18 21:26:30 +0000
commitec31b616982f137abdee8d0c6aa9dc4a6d103189 (patch)
treee4f5dc564be2b4ce5047a1f5acb2790fdc3b70ca /test/functional/activities_controller_test.rb
parent1db54e228d98d20536133bf52a8af0ce67616dc3 (diff)
downloadredmine-ec31b616982f137abdee8d0c6aa9dc4a6d103189.tar.gz
redmine-ec31b616982f137abdee8d0c6aa9dc4a6d103189.zip
Removes calls to #assert_template and #assigns in functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@15695 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/activities_controller_test.rb')
-rw-r--r--test/functional/activities_controller_test.rb25
1 files changed, 9 insertions, 16 deletions
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index fa3e44abf..5aacf6228 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -32,8 +32,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_project_index
get :index, :id => 1, :with_subprojects => 0
assert_response :success
- assert_template 'index'
- assert_not_nil assigns(:events_by_day)
assert_select 'h3', :text => /#{2.days.ago.to_date.day}/
assert_select 'dl dt.issue-edit a', :text => /(#{IssueStatus.find(2).name})/
@@ -47,8 +45,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_previous_project_index
get :index, :id => 1, :from => 2.days.ago.to_date
assert_response :success
- assert_template 'index'
- assert_not_nil assigns(:events_by_day)
assert_select 'h3', :text => /#{3.days.ago.to_date.day}/
assert_select 'dl dt.issue a', :text => /Cannot print recipes/
@@ -58,8 +54,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get :index
assert_response :success
- assert_template 'index'
- assert_not_nil assigns(:events_by_day)
i5 = Issue.find(5)
d5 = User.find(1).time_to_date(i5.created_on)
@@ -72,8 +66,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get :index, :user_id => 2
assert_response :success
- assert_template 'index'
- assert_not_nil assigns(:events_by_day)
assert_select 'h2 a[href="/users/2"]', :text => 'John Smith'
@@ -92,7 +84,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
def test_index_atom_feed
get :index, :format => 'atom', :with_subprojects => 0
assert_response :success
- assert_template 'common/feed'
assert_select 'feed' do
assert_select 'link[rel=self][href=?]', 'http://test.host/activity.atom?with_subprojects=0'
@@ -115,7 +106,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
:show_wiki_edits => 1
assert_response :success
- assert_template 'common/feed'
assert_select 'feed' do
assert_select 'link[rel=self][href=?]', 'http://test.host/activity.atom?show_changesets=1&show_documents=1&show_files=1&show_issues=1&show_messages=1&show_news=1&show_time_entries=1&show_wiki_edits=1&with_subprojects=0'
@@ -130,7 +120,6 @@ class ActivitiesControllerTest < Redmine::ControllerTest
with_settings :default_language => 'en' do
get :index, :format => 'atom', :show_issues => '1'
assert_response :success
- assert_template 'common/feed'
assert_select 'title', :text => /Issues/
end
@@ -140,22 +129,21 @@ class ActivitiesControllerTest < Redmine::ControllerTest
get :index, :user_id => 2, :format => 'atom'
assert_response :success
- assert_template 'common/feed'
assert_select 'title', :text => "Redmine: #{User.find(2).name}"
end
def test_index_should_show_private_notes_with_permission_only
- journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes with searchkeyword', :private_notes => true)
+ journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes', :private_notes => true)
@request.session[:user_id] = 2
get :index
assert_response :success
- assert_include journal, assigns(:events_by_day).values.flatten
+ assert_select 'dl', :text => /Private notes/
Role.find(1).remove_permission! :view_private_notes
get :index
assert_response :success
- assert_not_include journal, assigns(:events_by_day).values.flatten
+ assert_select 'dl', :text => /Private notes/, :count => 0
end
def test_index_with_submitted_scope_should_save_as_preference
@@ -174,6 +162,11 @@ class ActivitiesControllerTest < Redmine::ControllerTest
get :index
assert_response :success
- assert_equal %w(issues news), assigns(:activity).scope
+
+ assert_select '#activity_scope_form' do
+ assert_select 'input[checked=checked]', 2
+ assert_select 'input[name=show_issues][checked=checked]'
+ assert_select 'input[name=show_news][checked=checked]'
+ end
end
end