##// END OF EJS Templates
Copy issues via bulk update action....
Copy issues via bulk update action. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8538 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r8418:065376c160b0
r8418:065376c160b0
Show More
context_menus_controller_test.rb
148 lines | 7.0 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,
Jean-Philippe Lang
Add missing fixtures....
r7898 :enumerations,
:time_entries
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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => '/issues/bulk_update?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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bpriority_id%5D=8',
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=3',
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => '' }
assert_tag :tag => 'a', :content => 'eCookbook Subproject 1 - 2.0',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&amp;issue%5Bfixed_version_id%5D=4',
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => '' }
assert_tag :tag => 'a', :content => 'Dave Lopper',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => '/issues/bulk_update?ids%5B%5D=1&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 => 'Duplicate',
:attributes => { :href => '/projects/ecookbook/issues/1/copy',
:class => 'icon-duplicate' }
assert_tag :tag => 'a', :content => 'Copy',
Jean-Philippe Lang
Copy issues via bulk update action....
r8418 :attributes => { :href => '/issues/bulk_edit?copy=1&amp;ids%5B%5D=1',
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => 'icon-copy' }
Jean-Philippe Lang
Removed the "Move" button for single issue since it can be moved from the reguler update form....
r8413 assert_no_tag :tag => 'a', :content => 'Move'
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_tag :tag => 'a', :content => 'Delete',
Jean-Philippe Lang
Issue destroy is now DELETE only....
r8035 :attributes => { :href => '/issues?ids%5B%5D=1',
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => "/issues/bulk_update?#{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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => "/issues/bulk_update?#{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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => "/issues/bulk_update?#{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
Copy issues via bulk update action....
r8418 :attributes => { :href => "/issues/bulk_edit?copy=1&amp;#{ids}",
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 :class => 'icon-copy' }
Jean-Philippe Lang
Removed the "Move" button for issues since they can be moved from the bulk edit form....
r8417 assert_no_tag :tag => 'a', :content => 'Move'
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_tag :tag => 'a', :content => 'Delete',
Jean-Philippe Lang
Issue destroy is now DELETE only....
r8035 :attributes => { :href => "/issues?#{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',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bstatus_id%5D=5",
Jean-Baptiste Barth
Added ability to edit issues from different project through contextual menu (#5332)...
r4128 :class => '' }
assert_tag :tag => 'a', :content => 'Immediate',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bpriority_id%5D=8",
Jean-Baptiste Barth
Added ability to edit issues from different project through contextual menu (#5332)...
r4128 :class => '' }
assert_tag :tag => 'a', :content => 'John Smith',
Etienne Massip
Fixed broken issues context tests (#9794)....
r8091 :attributes => { :href => "/issues/bulk_update?#{ids}&amp;issue%5Bassigned_to_id%5D=2",
Jean-Baptiste Barth
Added ability to edit issues from different project through contextual menu (#5332)...
r4128 :class => '' }
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 assert_tag :tag => 'a', :content => 'Delete',
Jean-Philippe Lang
Issue destroy is now DELETE only....
r8035 :attributes => { :href => "/issues?#{ids}",
Jean-Baptiste Barth
Added ability to delete issues from different projects through contextual menu (#5332)...
r4122 :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
Jean-Philippe Lang
Fixed time entries context menu display according permissions (#9405)....
r7802
def test_time_entries_context_menu
@request.session[:user_id] = 2
get :time_entries, :ids => [1, 2]
assert_response :success
assert_template 'time_entries'
assert_tag 'a', :content => 'Edit'
assert_no_tag 'a', :content => 'Edit', :attributes => {:class => /disabled/}
end
def test_time_entries_context_menu_without_edit_permission
@request.session[:user_id] = 2
Role.find_by_name('Manager').remove_permission! :edit_time_entries
get :time_entries, :ids => [1, 2]
assert_response :success
assert_template 'time_entries'
assert_tag 'a', :content => 'Edit', :attributes => {:class => /disabled/}
end
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 end