##// END OF EJS Templates
Fix generation of blank local link when no title is specified in wiki link....
Fix generation of blank local link when no title is specified in wiki link. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7560 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r7369:ceb4a6f3fbe1
r7440:ac2dbde135f7
Show More
context_menus_controller_test.rb
132 lines | 6.6 KiB | text/x-ruby | RubyLexer
/ test / functional / context_menus_controller_test.rb
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892
class ContextMenusControllerTest < ActionController::TestCase
Toshi MARUYAMA
Rails3: replace "all" fixtures at test/functional/context_menus_controller_test.rb...
r7369 fixtures :projects,
:trackers,
:projects_trackers,
:roles,
:member_roles,
:members,
:auth_sources,
:enabled_modules,
:workflows,
:journals, :journal_details,
:versions,
:issues, :issue_statuses, :issue_categories,
:users,
:enumerations
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892
def test_context_menu_one_issue
@request.session[:user_id] = 2
get :issues, :ids => [1]
assert_response :success
assert_template 'context_menu'
assert_tag :tag => 'a', :content => 'Edit',
:attributes => { :href => '/issues/1/edit',
:class => 'icon-edit' }
assert_tag :tag => 'a', :content => 'Closed',
Jean-Baptiste Barth
Allow mass status update through context menu. #3411...
r3941 :attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bstatus_id%5D=5',
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => '' }
assert_tag :tag => 'a', :content => 'Immediate',
:attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bpriority_id%5D=8',
:class => '' }
Jean-Baptiste Barth
Do not show inactive issue priorities where not necessary (#8573)....
r5950 assert_no_tag :tag => 'a', :content => 'Inactive Priority'
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 # Versions
assert_tag :tag => 'a', :content => '2.0',
:attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=3',
:class => '' }
assert_tag :tag => 'a', :content => 'eCookbook Subproject 1 - 2.0',
:attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=4',
:class => '' }
assert_tag :tag => 'a', :content => 'Dave Lopper',
:attributes => { :href => '/issues/bulk_edit?ids%5B%5D=1&amp;issue%5Bassigned_to_id%5D=3',
:class => '' }
assert_tag :tag => 'a', :content => 'Duplicate',
:attributes => { :href => '/projects/ecookbook/issues/1/copy',
:class => 'icon-duplicate' }
assert_tag :tag => 'a', :content => 'Copy',
:attributes => { :href => '/issues/move/new?copy_options%5Bcopy%5D=t&amp;ids%5B%5D=1',
:class => 'icon-copy' }
assert_tag :tag => 'a', :content => 'Move',
:attributes => { :href => '/issues/move/new?ids%5B%5D=1',
:class => 'icon-move' }
assert_tag :tag => 'a', :content => 'Delete',
:attributes => { :href => '/issues/destroy?ids%5B%5D=1',
:class => 'icon-del' }
end
def test_context_menu_one_issue_by_anonymous
get :issues, :ids => [1]
assert_response :success
assert_template 'context_menu'
assert_tag :tag => 'a', :content => 'Delete',
:attributes => { :href => '#',
:class => 'icon-del disabled' }
end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/context_menus_controller_test.rb....
r6700
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 def test_context_menu_multiple_issues_of_same_project
@request.session[:user_id] = 2
get :issues, :ids => [1, 2]
assert_response :success
assert_template 'context_menu'
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 assert_not_nil assigns(:issues)
assert_equal [1, 2], assigns(:issues).map(&:id).sort
Toshi MARUYAMA
remove trailing white-spaces from test/functional/context_menus_controller_test.rb....
r6700
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 ids = assigns(:issues).map(&:id).map {|i| "ids%5B%5D=#{i}"}.join('&amp;')
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_tag :tag => 'a', :content => 'Edit',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/bulk_edit?#{ids}",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => 'icon-edit' }
Jean-Baptiste Barth
Allow mass status update through context menu. #3411...
r3941 assert_tag :tag => 'a', :content => 'Closed',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bstatus_id%5D=5",
Jean-Baptiste Barth
Allow mass status update through context menu. #3411...
r3941 :class => '' }
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_tag :tag => 'a', :content => 'Immediate',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bpriority_id%5D=8",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => '' }
assert_tag :tag => 'a', :content => 'Dave Lopper',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bassigned_to_id%5D=3",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => '' }
assert_tag :tag => 'a', :content => 'Copy',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/move/new?copy_options%5Bcopy%5D=t&amp;#{ids}",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => 'icon-copy' }
assert_tag :tag => 'a', :content => 'Move',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/move/new?#{ids}",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => 'icon-move' }
assert_tag :tag => 'a', :content => 'Delete',
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 :attributes => { :href => "/issues/destroy?#{ids}",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => 'icon-del' }
end
Jean-Baptiste Barth
Added ability to delete issues from different projects through contextual menu (#5332)...
r4122 def test_context_menu_multiple_issues_of_different_projects
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 @request.session[:user_id] = 2
Jean-Baptiste Barth
Added ability to delete issues from different projects through contextual menu (#5332)...
r4122 get :issues, :ids => [1, 2, 6]
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_response :success
assert_template 'context_menu'
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 assert_not_nil assigns(:issues)
assert_equal [1, 2, 6], assigns(:issues).map(&:id).sort
Toshi MARUYAMA
remove trailing white-spaces from test/functional/context_menus_controller_test.rb....
r6700
Jean-Philippe Lang
Trying to fix random failures with postgresql due to different ids order in urls....
r4553 ids = assigns(:issues).map(&:id).map {|i| "ids%5B%5D=#{i}"}.join('&amp;')
Jean-Baptiste Barth
Added ability to edit issues from different project through contextual menu (#5332)...
r4128 assert_tag :tag => 'a', :content => 'Edit',
:attributes => { :href => "/issues/bulk_edit?#{ids}",
:class => 'icon-edit' }
assert_tag :tag => 'a', :content => 'Closed',
:attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bstatus_id%5D=5",
:class => '' }
assert_tag :tag => 'a', :content => 'Immediate',
:attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bpriority_id%5D=8",
:class => '' }
assert_tag :tag => 'a', :content => 'John Smith',
:attributes => { :href => "/issues/bulk_edit?#{ids}&amp;issue%5Bassigned_to_id%5D=2",
:class => '' }
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_tag :tag => 'a', :content => 'Delete',
Jean-Baptiste Barth
Added ability to delete issues from different projects through contextual menu (#5332)...
r4122 :attributes => { :href => "/issues/destroy?#{ids}",
:class => 'icon-del' }
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 end
Toshi MARUYAMA
remove trailing white-spaces from test/functional/context_menus_controller_test.rb....
r6700
Jean-Philippe Lang
Find visible issues only in ContextMenusController#issues....
r4466 def test_context_menu_issue_visibility
get :issues, :ids => [1, 4]
assert_response :success
assert_template 'context_menu'
assert_equal [1], assigns(:issues).collect(&:id)
end
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 end