-<%= show_and_goto_link(l(:label_add_note), 'add-note', :class => 'icon icon-note') if authorize_for('issues', 'add_note') %>
+<%= show_and_goto_link(l(:button_update), 'update', :class => 'icon icon-note') if authorize_for('issues', 'update') %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
<%= watcher_tag(@issue, User.current) %>
@@ -81,16 +81,6 @@ end %>
-<% if authorize_for('issues', 'change_status') and @status_options and !@status_options.empty? %>
- <% form_tag({:controller => 'issues', :action => 'change_status', :id => @issue}) do %>
-
-
<%= l(:label_add_note) %>
- <% form_tag({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular", :multipart => true) do %>
-
- <%= text_area_tag 'notes', '', :cols => 60, :rows => 10, :class => 'wiki-edit' %>
- <%= wikitoolbar_for 'notes' %>
- <%= render :partial => 'attachments/form' %>
- <%= submit_tag l(:button_add) %>
- <%= toggle_link l(:button_cancel), 'add-note' %>
- <% end %>
+<% if authorize_for('issues', 'update') %>
+
+
+
<%= l(:button_update) %>
+ <%= render :partial => 'update' %>
+ <%= toggle_link l(:button_cancel), 'update' %>
<% end %>
diff --git a/app/views/issues/update.rhtml b/app/views/issues/update.rhtml
new file mode 100644
index 000000000..44e72da87
--- /dev/null
+++ b/app/views/issues/update.rhtml
@@ -0,0 +1,4 @@
+
<%= @issue.tracker.name %> #<%= @issue.id %>: <%=h @issue.subject %>
+
+<%= error_messages_for 'issue' %>
+<%= render :partial => 'update' %>
diff --git a/lang/bg.yml b/lang/bg.yml
index eeb6ef80b..57e7fd22d 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/cs.yml b/lang/cs.yml
index e99fe061b..5cbf1133d 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/de.yml b/lang/de.yml
index cd4e222ae..ba3dcda5b 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/en.yml b/lang/en.yml
index 7a1a2622f..eae61d7bf 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -462,6 +462,7 @@ label_registration_manual_activation: manual account activation
label_registration_automatic_activation: automatic account activation
label_display_per_page: 'Per page: %s'
label_age: Age
+label_change_properties: Change properties
button_login: Login
button_submit: Submit
@@ -498,6 +499,7 @@ button_rename: Rename
button_change_password: Change password
button_copy: Copy
button_annotate: Annotate
+button_update: Update
status_active: active
status_registered: registered
diff --git a/lang/es.yml b/lang/es.yml
index bae295586..1a3af0f5c 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -560,3 +560,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/fr.yml b/lang/fr.yml
index d47feceb2..ff2bf792f 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -462,6 +462,7 @@ label_registration_manual_activation: activation manuelle du compte
label_registration_automatic_activation: activation automatique du compte
label_display_per_page: 'Par page: %s'
label_age: Age
+label_change_properties: Changer les propriétés
button_login: Connexion
button_submit: Soumettre
@@ -498,6 +499,7 @@ button_rename: Renommer
button_change_password: Changer de mot de passe
button_copy: Copier
button_annotate: Annoter
+button_update: Mettre à jour
status_active: actif
status_registered: enregistré
diff --git a/lang/he.yml b/lang/he.yml
index e2277dc3d..d110ee8bf 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/it.yml b/lang/it.yml
index 709f41774..bb9440ffd 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/ja.yml b/lang/ja.yml
index 286fb5971..e4c13b34c 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -558,3 +558,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/ko.yml b/lang/ko.yml
index 52c9b5431..790598b8d 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/nl.yml b/lang/nl.yml
index 43e1704a4..2e18a6b7c 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -558,3 +558,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/pl.yml b/lang/pl.yml
index 77ae6bb66..0ee0e3792 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index 55e8b3fae..21d21b793 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/pt.yml b/lang/pt.yml
index 0a5661997..c7f05f8c8 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/ro.yml b/lang/ro.yml
index 1381adba9..6ebc3b0e5 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/ru.yml b/lang/ru.yml
index b293dc309..569e96884 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/sr.yml b/lang/sr.yml
index c842ec438..1d4f52539 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -558,3 +558,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/sv.yml b/lang/sv.yml
index 85fb19bcb..75f297c20 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -558,3 +558,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index 719a2e868..5bf47d943 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -557,3 +557,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lang/zh.yml b/lang/zh.yml
index 05134751f..16f4c7195 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -560,3 +560,5 @@ notice_default_data_loaded: Default configuration successfully loaded.
text_load_default_configuration: Load the default configuration
text_no_configuration_data: "Roles, trackers, issue statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded."
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
+button_update: Update
+label_change_properties: Change properties
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 9b29257bd..2dca9ed50 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -32,10 +32,9 @@ Redmine::AccessControl.map do |map|
:reports => :issue_report}, :public => true
map.permission :add_issues, {:projects => :add_issue}
map.permission :edit_issues, {:projects => :bulk_edit_issues,
- :issues => [:edit, :destroy_attachment]}
+ :issues => [:edit, :update, :destroy_attachment]}
map.permission :manage_issue_relations, {:issue_relations => [:new, :destroy]}
- map.permission :add_issue_notes, {:issues => :add_note}
- map.permission :change_issue_status, {:issues => :change_status}, :require => :loggedin
+ map.permission :add_issue_notes, {:issues => :update}
map.permission :move_issues, {:projects => :move_issues}, :require => :loggedin
map.permission :delete_issues, {:issues => :destroy}, :require => :member
# Queries
diff --git a/lib/redmine/default_data/loader.rb b/lib/redmine/default_data/loader.rb
index 0abb5572a..11bd2a0b4 100644
--- a/lib/redmine/default_data/loader.rb
+++ b/lib/redmine/default_data/loader.rb
@@ -53,7 +53,6 @@ module Redmine
:edit_issues,
:manage_issue_relations,
:add_issue_notes,
- :change_issue_status,
:save_queries,
:view_gantt,
:view_calendar,
@@ -74,7 +73,6 @@ module Redmine
:position => 3,
:permissions => [:add_issues,
:add_issue_notes,
- :change_issue_status,
:save_queries,
:view_gantt,
:view_calendar,
@@ -90,7 +88,6 @@ module Redmine
Role.non_member.update_attribute :permissions, [:add_issues,
:add_issue_notes,
- :change_issue_status,
:save_queries,
:view_gantt,
:view_calendar,
diff --git a/test/fixtures/enumerations.yml b/test/fixtures/enumerations.yml
index eeef99b5b..c90a997ee 100644
--- a/test/fixtures/enumerations.yml
+++ b/test/fixtures/enumerations.yml
@@ -31,3 +31,12 @@ enumerations_008:
name: Immediate
id: 8
opt: IPRI
+enumerations_009:
+ name: Design
+ id: 9
+ opt: ACTI
+enumerations_010:
+ name: Development
+ id: 10
+ opt: ACTI
+
\ No newline at end of file
diff --git a/test/fixtures/roles.yml b/test/fixtures/roles.yml
index a089a98f9..c4d417a09 100644
--- a/test/fixtures/roles.yml
+++ b/test/fixtures/roles.yml
@@ -9,7 +9,6 @@ roles_004:
- :edit_issues
- :manage_issue_relations
- :add_issue_notes
- - :change_issue_status
- :move_issues
- :save_queries
- :view_gantt
@@ -34,6 +33,7 @@ roles_005:
builtin: 2
permissions: |
---
+ - :add_issue_notes
- :view_gantt
- :view_calendar
- :view_time_entries
@@ -58,7 +58,6 @@ roles_001:
- :edit_issues
- :manage_issue_relations
- :add_issue_notes
- - :change_issue_status
- :move_issues
- :delete_issues
- :manage_public_queries
@@ -99,7 +98,6 @@ roles_002:
- :edit_issues
- :manage_issue_relations
- :add_issue_notes
- - :change_issue_status
- :move_issues
- :delete_issues
- :manage_public_queries
@@ -137,7 +135,6 @@ roles_003:
- :edit_issues
- :manage_issue_relations
- :add_issue_notes
- - :change_issue_status
- :move_issues
- :delete_issues
- :manage_public_queries
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml
index df7123879..de3553173 100644
--- a/test/fixtures/users.yml
+++ b/test/fixtures/users.yml
@@ -14,6 +14,7 @@ users_004:
auth_source_id:
mail_notification: true
login: rhill
+ type: User
users_001:
created_on: 2006-07-19 19:12:21 +02:00
status: 1
@@ -29,6 +30,7 @@ users_001:
auth_source_id:
mail_notification: true
login: admin
+ type: User
users_002:
created_on: 2006-07-19 19:32:09 +02:00
status: 1
@@ -44,6 +46,7 @@ users_002:
auth_source_id:
mail_notification: true
login: jsmith
+ type: User
users_003:
created_on: 2006-07-19 19:33:19 +02:00
status: 1
@@ -59,6 +62,7 @@ users_003:
auth_source_id:
mail_notification: true
login: dlopper
+ type: User
users_005:
id: 5
created_on: 2006-07-19 19:33:19 +02:00
@@ -75,3 +79,22 @@ users_005:
auth_source_id:
mail_notification: true
login: dlopper2
+ type: User
+users_006:
+ id: 6
+ created_on: 2006-07-19 19:33:19 +02:00
+ status: 1
+ last_login_on:
+ language: ''
+ hashed_password: 1
+ updated_on: 2006-07-19 19:33:19 +02:00
+ admin: false
+ mail: ''
+ lastname: Anonymous
+ firstname: ''
+ auth_source_id:
+ mail_notification: false
+ login: ''
+ type: AnonymousUser
+
+
\ No newline at end of file
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 06d2f1029..d60e32200 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -32,7 +32,8 @@ class IssuesControllerTest < Test::Unit::TestCase
:issue_categories,
:enabled_modules,
:enumerations,
- :attachments
+ :attachments,
+ :workflows
def setup
@controller = IssuesController.new
@@ -94,13 +95,37 @@ class IssuesControllerTest < Test::Unit::TestCase
assert_equal 'application/atom+xml', @response.content_type
end
- def test_show
+ def test_show_by_anonymous
get :show, :id => 1
assert_response :success
assert_template 'show.rhtml'
assert_not_nil assigns(:issue)
+ assert_equal Issue.find(1), assigns(:issue)
+
+ # anonymous role is allowed to add a note
+ assert_tag :tag => 'form',
+ :descendant => { :tag => 'fieldset',
+ :child => { :tag => 'legend',
+ :content => /Notes/ } }
end
+ def test_show_by_manager
+ @request.session[:user_id] = 2
+ get :show, :id => 1
+ assert_response :success
+
+ assert_tag :tag => 'form',
+ :descendant => { :tag => 'fieldset',
+ :child => { :tag => 'legend',
+ :content => /Change properties/ } },
+ :descendant => { :tag => 'fieldset',
+ :child => { :tag => 'legend',
+ :content => /Log time/ } },
+ :descendant => { :tag => 'fieldset',
+ :child => { :tag => 'legend',
+ :content => /Notes/ } }
+ end
+
def test_get_edit
@request.session[:user_id] = 2
get :edit, :id => 1
@@ -129,21 +154,100 @@ class IssuesControllerTest < Test::Unit::TestCase
assert mail.body.include?("Subject changed from #{old_subject} to #{new_subject}")
end
- def test_post_change_status
+ def test_get_update
+ @request.session[:user_id] = 2
+ get :update, :id => 1
+ assert_response :success
+ assert_template 'update'
+ end
+
+ def test_update_with_status_and_assignee_change
issue = Issue.find(1)
assert_equal 1, issue.status_id
@request.session[:user_id] = 2
- post :change_status, :id => 1,
- :new_status_id => 2,
- :issue => { :assigned_to_id => 3 },
- :notes => 'Assigned to dlopper',
- :confirm => 1
+ post :update,
+ :id => 1,
+ :issue => { :status_id => 2, :assigned_to_id => 3 },
+ :notes => 'Assigned to dlopper'
assert_redirected_to 'issues/show/1'
issue.reload
assert_equal 2, issue.status_id
- j = issue.journals.find(:first, :order => 'created_on DESC')
+ j = issue.journals.find(:first, :order => 'id DESC')
assert_equal 'Assigned to dlopper', j.notes
assert_equal 2, j.details.size
+
+ mail = ActionMailer::Base.deliveries.last
+ assert mail.body.include?("Status changed from New to Assigned")
+ end
+
+ def test_update_with_note_only
+ notes = 'Note added by IssuesControllerTest#test_update_with_note_only'
+ # anonymous user
+ post :update,
+ :id => 1,
+ :notes => notes
+ assert_redirected_to 'issues/show/1'
+ j = Issue.find(1).journals.find(:first, :order => 'id DESC')
+ assert_equal notes, j.notes
+ assert_equal 0, j.details.size
+ assert_equal User.anonymous, j.user
+
+ mail = ActionMailer::Base.deliveries.last
+ assert mail.body.include?(notes)
+ end
+
+ def test_update_with_note_and_spent_time
+ @request.session[:user_id] = 2
+ spent_hours_before = Issue.find(1).spent_hours
+ post :update,
+ :id => 1,
+ :notes => '2.5 hours added',
+ :time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
+ assert_redirected_to 'issues/show/1'
+
+ issue = Issue.find(1)
+
+ j = issue.journals.find(:first, :order => 'id DESC')
+ assert_equal '2.5 hours added', j.notes
+ assert_equal 0, j.details.size
+
+ t = issue.time_entries.find(:first, :order => 'id DESC')
+ assert_not_nil t
+ assert_equal 2.5, t.hours
+ assert_equal spent_hours_before + 2.5, issue.spent_hours
+ end
+
+ def test_update_with_attachment_only
+ # anonymous user
+ post :update,
+ :id => 1,
+ :notes => '',
+ :attachments => [ test_uploaded_file('testfile.txt', 'text/plain') ]
+ assert_redirected_to 'issues/show/1'
+ j = Issue.find(1).journals.find(:first, :order => 'id DESC')
+ assert j.notes.blank?
+ assert_equal 1, j.details.size
+ assert_equal 'testfile.txt', j.details.first.value
+ assert_equal User.anonymous, j.user
+
+ mail = ActionMailer::Base.deliveries.last
+ assert mail.body.include?('testfile.txt')
+ end
+
+ def test_update_with_no_change
+ issue = Issue.find(1)
+ issue.journals.clear
+ ActionMailer::Base.deliveries.clear
+
+ post :update,
+ :id => 1,
+ :notes => ''
+ assert_redirected_to 'issues/show/1'
+
+ issue.reload
+ assert issue.journals.empty?
+ # No email should be sent
+ assert ActionMailer::Base.deliveries.empty?
end
def test_context_menu
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb
index 702fbc026..a9d3f9c74 100644
--- a/test/integration/issues_test.rb
+++ b/test/integration/issues_test.rb
@@ -38,7 +38,9 @@ class IssuesTest < ActionController::IntegrationTest
def test_issue_attachements
log_user('jsmith', 'jsmith')
- post "issues/add_note/1", { :notes => 'Some notes', 'attachments[]' => ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/testfile.txt', 'text/plain') }
+ post 'issues/update/1',
+ :notes => 'Some notes',
+ :attachments => ([] << ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/testfile.txt', 'text/plain'))
assert_redirected_to "issues/show/1"
# make sure attachment was saved
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 542d4ce72..7c81c3607 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -53,6 +53,10 @@ class Test::Unit::TestCase
assert_redirected_to "my/page"
assert_equal login, User.find(session[:user_id]).login
end
+
+ def test_uploaded_file(name, mime)
+ ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + "/files/#{name}", mime)
+ end
end
@@ -70,4 +74,4 @@ class String
def read
self.to_s
end
-end
\ No newline at end of file
+end
diff --git a/vendor/plugins/gloc-1.1.0/lib/gloc-rails.rb b/vendor/plugins/gloc-1.1.0/lib/gloc-rails.rb
index 8f201bcb8..aa65991b0 100644
--- a/vendor/plugins/gloc-1.1.0/lib/gloc-rails.rb
+++ b/vendor/plugins/gloc-1.1.0/lib/gloc-rails.rb
@@ -155,6 +155,27 @@ module ActiveRecord #:nodoc:
# end
# end
+ class Errors
+ include GLoc
+
+ def full_messages
+ full_messages = []
+
+ @errors.each_key do |attr|
+ @errors[attr].each do |msg|
+ next if msg.nil?
+
+ if attr == "base"
+ full_messages << (msg.is_a?(Symbol) ? l(msg) : msg)
+ else
+ full_messages << @base.class.human_attribute_name(attr) + " " + (msg.is_a?(Symbol) ? l(msg) : msg)
+ end
+ end
+ end
+ full_messages
+ end
+ end
+
module Validations #:nodoc:
module ClassMethods
# The default Rails version of this function creates an error message and then