Merge pull request #633 from opf/bugfix/2534_moving_topics_between_boards

pull/657/head
Hagen Schink 11 years ago
commit 199f3a3e65
  1. 2
      app/models/message.rb
  2. 3
      doc/CHANGELOG.md
  3. 2
      spec/controllers/boards_controller_spec.rb
  4. 16
      spec/controllers/messages_controller_spec.rb

@ -71,7 +71,7 @@ class Message < ActiveRecord::Base
scope :visible, lambda {|*args| { :include => {:board => :project},
:conditions => Project.allowed_to_condition(args.first || User.current, :view_messages) } }
safe_attributes 'subject', 'content'
safe_attributes 'subject', 'content', 'board_id'
safe_attributes 'locked', 'sticky',
:if => lambda {|message, user|
user.allowed_to?(:edit_messages, message.project)

@ -31,7 +31,8 @@ See doc/COPYRIGHT.rdoc for more details.
* `#313` Fix: Changing the menu title of a menu wiki page does not work
* `#1368` Fix: Readding project members in user admin view
* `#1961` Sort project by time should only include work packages that are shown within the timeline report
* `#1961` Sort project by time should only include work packages that are shown within the timeline report
* `#2534` Fix: [Forums] Moving topics between boards doesn't work
* `#2653` Remove relative vertical offset corrections and custom border fixes for IE8.
* `#2654` Remove custom font rendering/kerning as well as VML from timelines.
* `#2655` Find a sensible default for Timelines rendering bucket size.

@ -127,7 +127,7 @@ describe BoardsController do
before do
as_logged_in_user user do
post :update, id: board.id,
put :update, id: board.id,
project_id: board.project_id,
board: {:name => 'New name', :description => 'New description'}
end

@ -73,6 +73,20 @@ describe MessagesController do
end
end
describe :update do
let(:message) { FactoryGirl.create :message, board: board }
let(:other_board) { FactoryGirl.create :board, project: project }
before do
role.add_permission!(:edit_messages) and user.reload
put :update, id: message, message: {board_id: other_board}
end
it 'allows for changing the board' do
message.reload.board.should == other_board
end
end
describe :attachment do
let!(:message) { FactoryGirl.create(:message) }
let(:attachment_id) { "attachments_#{message.attachments.first.id}".to_sym }
@ -94,7 +108,7 @@ describe MessagesController do
before do
Attachment.any_instance.stub(:filesize).and_return(max_filesize + 1)
post :update, params
put :update, params
end
describe :view do

Loading…
Cancel
Save