summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-23 10:53:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-23 10:53:21 +0000
commit9b1ebd6808d260a95eff38c2a93ec2c1b7ed8183 (patch)
tree63f1b433deebd1590299380157c87dbb54e59c48 /test/functional
parentd1244b31a4c2c6f8a5625f92506f7e281fb1cc00 (diff)
downloadredmine-9b1ebd6808d260a95eff38c2a93ec2c1b7ed8183.tar.gz
redmine-9b1ebd6808d260a95eff38c2a93ec2c1b7ed8183.zip
Refactor: makes issue id a regular QueryColumn.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11447 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb14
-rw-r--r--test/functional/queries_controller_test.rb2
2 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 65e28b570..df3c2e330 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -380,7 +380,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'text/csv; header=present', @response.content_type
assert @response.body.starts_with?("#,")
lines = @response.body.chomp.split("\n")
- assert_equal assigns(:query).columns.size + 1, lines[0].split(',').size
+ assert_equal assigns(:query).columns.size, lines[0].split(',').size
end
def test_index_csv_with_project
@@ -397,7 +397,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'text/csv; header=present', @response.content_type
assert @response.body.starts_with?("#,")
lines = @response.body.chomp.split("\n")
- assert_equal assigns(:query).columns.size + 2, lines[0].split(',').size
+ assert_equal assigns(:query).columns.size + 1, lines[0].split(',').size
end
def test_index_csv_with_spent_time_column
@@ -416,9 +416,9 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_not_nil assigns(:issues)
assert_equal 'text/csv; header=present', @response.content_type
- assert @response.body.starts_with?("#,")
- lines = @response.body.chomp.split("\n")
- assert_equal assigns(:query).available_inline_columns.size + 1, lines[0].split(',').size
+ assert_match /\A#,/, response.body
+ lines = response.body.chomp.split("\n")
+ assert_equal assigns(:query).available_inline_columns.size, lines[0].split(',').size
end
def test_index_csv_with_multi_column_field
@@ -708,12 +708,12 @@ class IssuesControllerTest < ActionController::TestCase
# query should use specified columns
query = assigns(:query)
assert_kind_of IssueQuery, query
- assert_equal [:project, :tracker, :subject, :assigned_to], query.columns.map(&:name)
+ assert_equal [:id, :project, :tracker, :subject, :assigned_to], query.columns.map(&:name)
end
def test_index_without_project_and_explicit_default_columns_should_not_add_project_column
Setting.issue_list_default_columns = ['tracker', 'subject', 'assigned_to']
- columns = ['tracker', 'subject', 'assigned_to']
+ columns = ['id', 'tracker', 'subject', 'assigned_to']
get :index, :set_filter => 1, :c => columns
# query should use specified columns
diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb
index 8a4e49182..a232fec2e 100644
--- a/test/functional/queries_controller_test.rb
+++ b/test/functional/queries_controller_test.rb
@@ -114,7 +114,7 @@ class QueriesControllerTest < ActionController::TestCase
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => nil, :query_id => q
assert !q.is_public?
assert !q.has_default_columns?
- assert_equal [:tracker, :subject, :priority, :category], q.columns.collect {|c| c.name}
+ assert_equal [:id, :tracker, :subject, :priority, :category], q.columns.collect {|c| c.name}
assert q.valid?
end