"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/functional/issues_controller_test.rb" between
redmine-4.0.3.tar.gz and redmine-4.0.4.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

issues_controller_test.rb  (redmine-4.0.3):issues_controller_test.rb  (redmine-4.0.4)
skipping to change at line 594 skipping to change at line 594
} }
assert_select '#csv-export-form input[name=?][value=?]', 'f[]', '' assert_select '#csv-export-form input[name=?][value=?]', 'f[]', ''
end end
def test_index_csv def test_index_csv
get :index, :params => { get :index, :params => {
:format => 'csv' :format => 'csv'
} }
assert_response :success assert_response :success
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
assert response.body.starts_with?("#,") assert response.body.starts_with?("#,")
lines = response.body.chomp.split("\n") lines = response.body.chomp.split("\n")
# default columns + id and project # default columns + id and project
assert_equal Setting.issue_list_default_columns.size + 2, lines[0].split(',' ).size assert_equal Setting.issue_list_default_columns.size + 2, lines[0].split(',' ).size
end end
def test_index_csv_with_project def test_index_csv_with_project
get :index, :params => { get :index, :params => {
:project_id => 1, :project_id => 1,
:format => 'csv' :format => 'csv'
} }
assert_response :success assert_response :success
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
end end
def test_index_csv_without_any_filters def test_index_csv_without_any_filters
@request.session[:user_id] = 1 @request.session[:user_id] = 1
Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 5, :subject => 'Closed issue', :author_id => 1) Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 5, :subject => 'Closed issue', :author_id => 1)
get :index, :params => { get :index, :params => {
:set_filter => 1, :set_filter => 1,
:f => [''], :f => [''],
:format => 'csv' :format => 'csv'
} }
skipping to change at line 636 skipping to change at line 636
with_settings :default_language => 'en' do with_settings :default_language => 'en' do
get :index, :params => { get :index, :params => {
:format => 'csv', :format => 'csv',
:c => [:tracker, :c => [:tracker,
:description] :description]
} }
assert_response :success assert_response :success
end end
assert_equal 'text/csv; header=present', response.content_type assert_equal 'text/csv', response.content_type
headers = response.body.chomp.split("\n").first.split(',') headers = response.body.chomp.split("\n").first.split(',')
assert_include 'Description', headers assert_include 'Description', headers
assert_include 'test_index_csv_with_description', response.body assert_include 'test_index_csv_with_description', response.body
end end
def test_index_csv_with_spent_time_column def test_index_csv_with_spent_time_column
issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'test_ index_csv_with_spent_time_column', :author_id => 2) issue = Issue.create!(:project_id => 1, :tracker_id => 1, :subject => 'test_ index_csv_with_spent_time_column', :author_id => 2)
TimeEntry.create!(:project => issue.project, :issue => issue, :hours => 7.33 , :user => User.find(2), :spent_on => Date.today) TimeEntry.create!(:project => issue.project, :issue => issue, :hours => 7.33 , :user => User.find(2), :spent_on => Date.today)
get :index, :params => { get :index, :params => {
:format => 'csv', :format => 'csv',
:set_filter => '1', :set_filter => '1',
:c => %w(subject spent_hours) :c => %w(subject spent_hours)
} }
assert_response :success assert_response :success
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
lines = @response.body.chomp.split("\n") lines = @response.body.chomp.split("\n")
assert_include "#{issue.id},#{issue.subject},7.33", lines assert_include "#{issue.id},#{issue.subject},7.33", lines
end end
def test_index_csv_with_all_columns def test_index_csv_with_all_columns
get :index, :params => { get :index, :params => {
:format => 'csv', :format => 'csv',
:c => ['all_inline'] :c => ['all_inline']
} }
assert_response :success assert_response :success
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
assert_match /\A#,/, response.body assert_match /\A#,/, response.body
lines = response.body.chomp.split("\n") lines = response.body.chomp.split("\n")
assert_equal IssueQuery.new.available_inline_columns.size, lines[0].split(', ').size assert_equal IssueQuery.new.available_inline_columns.size, lines[0].split(', ').size
end end
def test_index_csv_with_multi_column_field def test_index_csv_with_multi_column_field
CustomField.find(1).update_attribute :multiple, true CustomField.find(1).update_attribute :multiple, true
issue = Issue.find(1) issue = Issue.find(1)
issue.custom_field_values = {1 => ['MySQL', 'Oracle']} issue.custom_field_values = {1 => ['MySQL', 'Oracle']}
issue.save! issue.save!
skipping to change at line 736 skipping to change at line 736
with_settings :default_language => "zh-TW" do with_settings :default_language => "zh-TW" do
str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8') str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8')
str_big5 = "\xa4@\xa4\xeb".force_encoding('Big5') str_big5 = "\xa4@\xa4\xeb".force_encoding('Big5')
issue = Issue.generate!(:subject => str_utf8) issue = Issue.generate!(:subject => str_utf8)
get :index, :params => { get :index, :params => {
:project_id => 1, :project_id => 1,
:subject => str_utf8, :subject => str_utf8,
:format => 'csv' :format => 'csv'
} }
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
lines = @response.body.chomp.split("\n") lines = @response.body.chomp.split("\n")
header = lines[0] header = lines[0]
status = "\xaa\xac\xbaA".force_encoding('Big5') status = "\xaa\xac\xbaA".force_encoding('Big5')
assert_include status, header assert_include status, header
issue_line = lines.find {|l| l =~ /^#{issue.id},/} issue_line = lines.find {|l| l =~ /^#{issue.id},/}
assert_include str_big5, issue_line assert_include str_big5, issue_line
end end
end end
def test_index_csv_cannot_convert_should_be_replaced_big_5 def test_index_csv_cannot_convert_should_be_replaced_big_5
skipping to change at line 758 skipping to change at line 758
str_utf8 = "\xe4\xbb\xa5\xe5\x86\x85".force_encoding('UTF-8') str_utf8 = "\xe4\xbb\xa5\xe5\x86\x85".force_encoding('UTF-8')
issue = Issue.generate!(:subject => str_utf8) issue = Issue.generate!(:subject => str_utf8)
get :index, :params => { get :index, :params => {
:project_id => 1, :project_id => 1,
:subject => str_utf8, :subject => str_utf8,
:c => ['status', 'subject'], :c => ['status', 'subject'],
:format => 'csv', :format => 'csv',
:set_filter => 1 :set_filter => 1
} }
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
lines = @response.body.chomp.split("\n") lines = @response.body.chomp.split("\n")
header = lines[0] header = lines[0]
issue_line = lines.find {|l| l =~ /^#{issue.id},/} issue_line = lines.find {|l| l =~ /^#{issue.id},/}
s1 = "\xaa\xac\xbaA".force_encoding('Big5') # status s1 = "\xaa\xac\xbaA".force_encoding('Big5') # status
assert header.include?(s1) assert header.include?(s1)
s2 = issue_line.split(",")[2] s2 = issue_line.split(",")[2]
s3 = "\xa5H?".force_encoding('Big5') # subject s3 = "\xa5H?".force_encoding('Big5') # subject
assert_equal s3, s2 assert_equal s3, s2
end end
end end
skipping to change at line 782 skipping to change at line 782
str1 = "test_index_csv_tw" str1 = "test_index_csv_tw"
issue = Issue.generate!(:subject => str1, :estimated_hours => '1234.5') issue = Issue.generate!(:subject => str1, :estimated_hours => '1234.5')
get :index, :params => { get :index, :params => {
:project_id => 1, :project_id => 1,
:subject => str1, :subject => str1,
:c => ['estimated_hours', 'subject'], :c => ['estimated_hours', 'subject'],
:format => 'csv', :format => 'csv',
:set_filter => 1 :set_filter => 1
} }
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
lines = @response.body.chomp.split("\n") lines = @response.body.chomp.split("\n")
assert_include "#{issue.id},1234.50,#{str1}", lines assert_include "#{issue.id},1234.50,#{str1}", lines
end end
end end
def test_index_csv_fr def test_index_csv_fr
with_settings :default_language => "fr" do with_settings :default_language => "fr" do
str1 = "test_index_csv_fr" str1 = "test_index_csv_fr"
issue = Issue.generate!(:subject => str1, :estimated_hours => '1234.5') issue = Issue.generate!(:subject => str1, :estimated_hours => '1234.5')
get :index, :params => { get :index, :params => {
:project_id => 1, :project_id => 1,
:subject => str1, :subject => str1,
:c => ['estimated_hours', 'subject'], :c => ['estimated_hours', 'subject'],
:format => 'csv', :format => 'csv',
:set_filter => 1 :set_filter => 1
} }
assert_equal 'text/csv; header=present', @response.content_type assert_equal 'text/csv', @response.content_type
lines = @response.body.chomp.split("\n") lines = @response.body.chomp.split("\n")
assert_include "#{issue.id};1234,50;#{str1}", lines assert_include "#{issue.id};1234,50;#{str1}", lines
end end
end end
def test_index_csv_should_not_change_selected_columns def test_index_csv_should_not_change_selected_columns
get :index, :params => { get :index, :params => {
:set_filter => 1, :set_filter => 1,
:c => ["subject", "due_date"], :c => ["subject", "due_date"],
:project_id => "ecookbook" :project_id => "ecookbook"
skipping to change at line 1266 skipping to change at line 1266
assert_select "tr#issue-3 td.relations" do assert_select "tr#issue-3 td.relations" do
assert_select "span", 0 assert_select "span", 0
end end
get :index, :params => { get :index, :params => {
:set_filter => 1, :set_filter => 1,
:c => %w(relations), :c => %w(relations),
:format => 'csv' :format => 'csv'
} }
assert_response :success assert_response :success
assert_equal 'text/csv; header=present', response.content_type assert_equal 'text/csv', response.content_type
lines = response.body.chomp.split("\n") lines = response.body.chomp.split("\n")
assert_include '1,"Related to #7, Related to #8, Blocks #11"', lines assert_include '1,"Related to #7, Related to #8, Blocks #11"', lines
assert_include '2,Blocked by #12', lines assert_include '2,Blocked by #12', lines
assert_include '3,""', lines assert_include '3,""', lines
get :index, :params => { get :index, :params => {
:set_filter => 1, :set_filter => 1,
:c => %w(subject relations), :c => %w(subject relations),
:format => 'pdf' :format => 'pdf'
} }
 End of changes. 10 change blocks. 
10 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)