summaryrefslogtreecommitdiffstats
path: root/test/functional/my_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-15 18:14:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-15 18:14:58 +0000
commitc23f126f1fa233c8bccddb7e4e113a20610e4252 (patch)
tree7f4b536047e2719e970589bcfcd7c197908cc45d /test/functional/my_controller_test.rb
parent674e1752e6fc6fc09efbf8a7a2b916c77c03bcee (diff)
downloadredmine-c23f126f1fa233c8bccddb7e4e113a20610e4252.tar.gz
redmine-c23f126f1fa233c8bccddb7e4e113a20610e4252.zip
Fix link to issues when displaying a project query (#1565).
git-svn-id: http://svn.redmine.org/redmine/trunk@16409 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/my_controller_test.rb')
-rw-r--r--test/functional/my_controller_test.rb25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb
index f6771a1f5..09cb1a834 100644
--- a/test/functional/my_controller_test.rb
+++ b/test/functional/my_controller_test.rb
@@ -108,7 +108,7 @@ class MyControllerTest < Redmine::ControllerTest
end
end
- def test_page_with_issuequery_block_and_selected_query
+ def test_page_with_issuequery_block_and_global_query
user = User.find(2)
query = IssueQuery.create!(:name => 'All issues', :user => user, :column_names => [:tracker, :subject, :status, :assigned_to])
user.pref.my_page_layout = {'top' => ['issuequery']}
@@ -119,6 +119,7 @@ class MyControllerTest < Redmine::ControllerTest
assert_response :success
assert_select '#block-issuequery' do
+ assert_select 'a[href=?]', "/issues?query_id=#{query.id}"
# assert number of columns (columns from query + id column + checkbox column)
assert_select 'table.issues th', 6
# assert results limit
@@ -127,7 +128,27 @@ class MyControllerTest < Redmine::ControllerTest
end
end
- def test_page_with_issuequery_block_and_selected_query_and_custom_columns
+ def test_page_with_issuequery_block_and_project_query
+ user = User.find(2)
+ query = IssueQuery.create!(:name => 'All issues', :project => Project.find(1), :user => user, :column_names => [:tracker, :subject, :status, :assigned_to])
+ user.pref.my_page_layout = {'top' => ['issuequery']}
+ user.pref.my_page_settings = {'issuequery' => {:query_id => query.id}}
+ user.pref.save!
+
+ get :page
+ assert_response :success
+
+ assert_select '#block-issuequery' do
+ assert_select 'a[href=?]', "/projects/ecookbook/issues?query_id=#{query.id}"
+ # assert number of columns (columns from query + id column + checkbox column)
+ assert_select 'table.issues th', 6
+ # assert results limit
+ assert_select 'table.issues tr.issue', 10
+ assert_select 'table.issues td.assigned_to'
+ end
+ end
+
+ def test_page_with_issuequery_block_and_query_should_display_custom_columns
user = User.find(2)
query = IssueQuery.create!(:name => 'All issues', :user => user, :column_names => [:tracker, :subject, :status, :assigned_to])
user.pref.my_page_layout = {'top' => ['issuequery']}