diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-07-18 11:28:56 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-07-18 11:28:56 +0200 |
commit | 55d853ecb1dec1d9703e908da7198894f04f40c4 (patch) | |
tree | 22e474f8236e9847fc7ea9dc0328ebb84b33189c /test | |
parent | 20199aec0c4aa564b54578b384a24e1e2b5aa454 (diff) | |
download | ecs2-55d853ecb1dec1d9703e908da7198894f04f40c4.tar.gz ecs2-55d853ecb1dec1d9703e908da7198894f04f40c4.zip |
Code shaping.
Function aliases in message model:
alias destroy_as_receiver destroy_unlinked_and_not_postrouted
alias destroy_as_sender destroy_
and code moved from messages_controller to message model.
I have also removed the :dependent => :destroy declaration from the
has_many :membership_messages declaration, because the deletion of the
membership_messages will be done explicitely from the message model when
deleting a message (via destroy_as_receive and destroy_as_sender). And
this deletion *must* depend on the calling participant.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/messages_controller_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 7c3e125..ebe7aa4 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -214,6 +214,7 @@ class MessagesControllerTest < ActionController::TestCase @request.set_REQUEST_URI("/numlab/solutions") @request.env["X-EcsAuthId"] = identities(:numlab_comp_id1).name /[0-9]+$/ =~ @response.header['LOCATION'] + memberships = Membership.receiver(identities(:numlab_comp_id1).participant, $~.to_s.to_i) post :destroy, { :id => $~.to_s.to_i } assert_response 200 assert_equal $~.to_s, @request.parameters[:id] |