summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 12:38:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 12:38:48 +0000
commitc084ef509f114d0d32891fc58d45817e6e11fa4e (patch)
tree4f658caf8daa7437836b912981df024efb0f133a
parent9dae5771bc8da2d43359931ea62138d8ed150902 (diff)
downloadredmine-c084ef509f114d0d32891fc58d45817e6e11fa4e.tar.gz
redmine-c084ef509f114d0d32891fc58d45817e6e11fa4e.zip
Adds a few functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13718 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/activities_controller_test.rb8
-rw-r--r--test/functional/attachments_controller_test.rb5
-rw-r--r--test/functional/context_menus_controller_test.rb9
3 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index 0c0fbb268..2a9af2d95 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -136,6 +136,14 @@ class ActivitiesControllerTest < ActionController::TestCase
end
end
+ def test_index_atom_feed_with_user
+ 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)
@request.session[:user_id] = 2
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index c1b27c64e..d0fde7c27 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -350,6 +350,11 @@ class AttachmentsControllerTest < ActionController::TestCase
assert_response 404
end
+ def test_edit_invalid_object_should_return_404
+ get :edit, :object_type => 'issues', :object_id => '999'
+ assert_response 404
+ end
+
def test_edit_for_object_that_is_not_visible_should_return_403
get :edit, :object_type => 'issues', :object_id => '4'
assert_response 403
diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb
index ec62d4307..5ff5a85c9 100644
--- a/test/functional/context_menus_controller_test.rb
+++ b/test/functional/context_menus_controller_test.rb
@@ -250,6 +250,15 @@ class ContextMenusControllerTest < ActionController::TestCase
assert_select 'a:not(.disabled)', :text => 'Edit'
end
+ def test_context_menu_for_one_time_entry
+ @request.session[:user_id] = 2
+ get :time_entries, :ids => [1]
+ assert_response :success
+ assert_template 'context_menus/time_entries'
+
+ assert_select 'a:not(.disabled)', :text => 'Edit'
+ end
+
def test_time_entries_context_menu_should_include_custom_fields
field = TimeEntryCustomField.generate!(:name => "Field", :field_format => "list", :possible_values => ["foo", "bar"])