has_messages 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +7 -1
- data/LICENSE +1 -1
- data/README.rdoc +4 -5
- data/Rakefile +2 -2
- data/app/models/message.rb +9 -18
- data/app/models/message_recipient.rb +8 -23
- data/db/migrate/001_create_messages.rb +1 -2
- data/lib/has_messages.rb +6 -3
- data/test/app_root/config/environment.rb +2 -2
- data/test/app_root/db/migrate/002_migrate_has_messages_to_version_2.rb +6 -2
- data/test/functional/has_messages_test.rb +6 -6
- data/test/unit/message_recipient_test.rb +14 -14
- data/test/unit/message_test.rb +14 -14
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
== master
|
2
2
|
|
3
|
-
== 0.
|
3
|
+
== 0.4.0 / 2009-04-19
|
4
|
+
|
5
|
+
* Add dependency on Rails 2.3
|
6
|
+
* Add dependency on plugin_test_helper 0.3.0
|
7
|
+
* Add dependency on state_machine 0.7.0
|
8
|
+
|
9
|
+
== 0.3.1 / 2009-01-11
|
4
10
|
|
5
11
|
* Use a state machine for the hidden_at field on Message/MessageRecipient
|
6
12
|
* Add dependency on state_machine 0.5.0
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -28,8 +28,8 @@ between users, but can also act as a way for the web application to send notices
|
|
28
28
|
and other notifications to users.
|
29
29
|
|
30
30
|
Designing and building a framework that supports this can be complex and takes
|
31
|
-
away from the business focus. This plugin can help ease that process by
|
32
|
-
a
|
31
|
+
away from the business focus. This plugin can help ease that process by
|
32
|
+
demonstrating a reference implementation of these features.
|
33
33
|
|
34
34
|
== Usage
|
35
35
|
|
@@ -45,7 +45,7 @@ This will build the following associations:
|
|
45
45
|
* +sent_messages+
|
46
46
|
* +received_messages+
|
47
47
|
|
48
|
-
If you have more
|
48
|
+
If you have more specific needs, you can create the same associations manually
|
49
49
|
that +has_messages+ builds. See HasMessages::MacroMethods#has_messages
|
50
50
|
for more information about the asssociations that are generated from this macro.
|
51
51
|
|
@@ -97,6 +97,5 @@ To run against a specific version of Rails:
|
|
97
97
|
|
98
98
|
== Dependencies
|
99
99
|
|
100
|
-
* Rails 2.
|
100
|
+
* Rails 2.3 or later
|
101
101
|
* state_machine[http://github.com/pluginaweek/state_machine]
|
102
|
-
* plugins_plus[http://github.com/pluginaweek/plugins_plugins] (optional if app files are copied to your project tree)
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake/contrib/sshpublisher'
|
|
5
5
|
|
6
6
|
spec = Gem::Specification.new do |s|
|
7
7
|
s.name = 'has_messages'
|
8
|
-
s.version = '0.
|
8
|
+
s.version = '0.4.0'
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.summary = 'Demonstrates a reference implementation for sending messages between users.'
|
11
11
|
|
@@ -13,7 +13,7 @@ spec = Gem::Specification.new do |s|
|
|
13
13
|
s.require_path = 'lib'
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.test_files = Dir['test/**/*_test.rb']
|
16
|
-
s.add_dependency 'state_machine', '>= 0.
|
16
|
+
s.add_dependency 'state_machine', '>= 0.7.0'
|
17
17
|
|
18
18
|
s.author = 'Aaron Pfeifer'
|
19
19
|
s.email = 'aaron@pluginaweek.org'
|
data/app/models/message.rb
CHANGED
@@ -26,37 +26,28 @@
|
|
26
26
|
# * +hide+ -Hides the message from the sender
|
27
27
|
# * +unhide+ - Makes the message visible again
|
28
28
|
class Message < ActiveRecord::Base
|
29
|
-
belongs_to :sender,
|
30
|
-
|
31
|
-
has_many :recipients,
|
32
|
-
:class_name => 'MessageRecipient',
|
33
|
-
:order => 'kind DESC, position ASC',
|
34
|
-
:dependent => :destroy
|
29
|
+
belongs_to :sender, :polymorphic => true
|
30
|
+
has_many :recipients, :class_name => 'MessageRecipient', :order => 'kind DESC, position ASC', :dependent => :destroy
|
35
31
|
|
36
|
-
validates_presence_of :state,
|
37
|
-
:sender_id,
|
38
|
-
:sender_type
|
32
|
+
validates_presence_of :state, :sender_id, :sender_type
|
39
33
|
|
40
|
-
attr_accessible :subject,
|
41
|
-
:body,
|
42
|
-
:to, :cc, :bcc
|
34
|
+
attr_accessible :subject, :body, :to, :cc, :bcc
|
43
35
|
|
44
36
|
after_save :update_recipients
|
45
37
|
|
46
|
-
named_scope :visible,
|
47
|
-
:conditions => {:hidden_at => nil}
|
38
|
+
named_scope :visible, :conditions => {:hidden_at => nil}
|
48
39
|
|
49
40
|
# Define actions for the message
|
50
41
|
state_machine :state, :initial => :unsent do
|
51
42
|
# Queues the message so that it's sent in a separate process
|
52
43
|
event :queue do
|
53
|
-
transition :
|
44
|
+
transition :unsent => :queued, :if => :has_recipients?
|
54
45
|
end
|
55
46
|
|
56
47
|
# Sends the message to all of the recipients as long as at least one
|
57
48
|
# recipient has been added
|
58
49
|
event :deliver do
|
59
|
-
transition :
|
50
|
+
transition [:unsent, :queued] => :sent, :if => :has_recipients?
|
60
51
|
end
|
61
52
|
end
|
62
53
|
|
@@ -64,12 +55,12 @@ class Message < ActiveRecord::Base
|
|
64
55
|
state_machine :hidden_at, :initial => :visible do
|
65
56
|
# Hides the message from the recipient's inbox
|
66
57
|
event :hide do
|
67
|
-
transition
|
58
|
+
transition all => :hidden
|
68
59
|
end
|
69
60
|
|
70
61
|
# Makes the message visible in the recipient's inbox
|
71
62
|
event :unhide do
|
72
|
-
transition
|
63
|
+
transition all => :visible
|
73
64
|
end
|
74
65
|
|
75
66
|
state :visible, :value => nil
|
@@ -27,41 +27,26 @@
|
|
27
27
|
# * +unhide+ - Makes the message visible again
|
28
28
|
class MessageRecipient < ActiveRecord::Base
|
29
29
|
belongs_to :message
|
30
|
-
belongs_to :receiver,
|
31
|
-
:polymorphic => true
|
30
|
+
belongs_to :receiver, :polymorphic => true
|
32
31
|
|
33
|
-
validates_presence_of :message_id,
|
34
|
-
:kind,
|
35
|
-
:state,
|
36
|
-
:receiver_id,
|
37
|
-
:receiver_type
|
32
|
+
validates_presence_of :message_id, :kind, :state, :receiver_id, :receiver_type
|
38
33
|
|
39
|
-
attr_protected
|
40
|
-
:position,
|
41
|
-
:hidden_at
|
34
|
+
attr_protected :state, :position, :hidden_at
|
42
35
|
|
43
36
|
before_create :set_position
|
44
37
|
before_destroy :reorder_positions
|
45
38
|
|
46
39
|
# Make this class look like the actual message
|
47
|
-
delegate :sender,
|
48
|
-
:subject,
|
49
|
-
:body,
|
50
|
-
:recipients,
|
51
|
-
:to,
|
52
|
-
:cc,
|
53
|
-
:bcc,
|
54
|
-
:created_at,
|
40
|
+
delegate :sender, :subject, :body, :recipients, :to, :cc, :bcc, :created_at,
|
55
41
|
:to => :message
|
56
42
|
|
57
|
-
named_scope :visible,
|
58
|
-
:conditions => {:hidden_at => nil}
|
43
|
+
named_scope :visible, :conditions => {:hidden_at => nil}
|
59
44
|
|
60
45
|
# Defines actions for the recipient
|
61
46
|
state_machine :state, :initial => :unread do
|
62
47
|
# Indicates that the message has been viewed by the receiver
|
63
48
|
event :view do
|
64
|
-
transition :
|
49
|
+
transition :unread => :read, :if => :message_sent?
|
65
50
|
end
|
66
51
|
end
|
67
52
|
|
@@ -69,12 +54,12 @@ class MessageRecipient < ActiveRecord::Base
|
|
69
54
|
state_machine :hidden_at, :initial => :visible do
|
70
55
|
# Hides the message from the recipient's inbox
|
71
56
|
event :hide do
|
72
|
-
transition
|
57
|
+
transition all => :hidden
|
73
58
|
end
|
74
59
|
|
75
60
|
# Makes the message visible in the recipient's inbox
|
76
61
|
event :unhide do
|
77
|
-
transition
|
62
|
+
transition all => :visible
|
78
63
|
end
|
79
64
|
|
80
65
|
state :visible, :value => nil
|
@@ -2,8 +2,7 @@ class CreateMessages < ActiveRecord::Migration
|
|
2
2
|
def self.up
|
3
3
|
create_table :messages do |t|
|
4
4
|
t.references :sender, :polymorphic => true, :null => false
|
5
|
-
t.text :subject
|
6
|
-
t.text :body
|
5
|
+
t.text :subject, :body
|
7
6
|
t.string :state, :null => false
|
8
7
|
t.datetime :hidden_at
|
9
8
|
t.string :type
|
data/lib/has_messages.rb
CHANGED
@@ -4,12 +4,15 @@ require 'state_machine'
|
|
4
4
|
module HasMessages
|
5
5
|
module MacroMethods
|
6
6
|
# Creates the following message associations:
|
7
|
-
# * +messages+ - Messages that were composed and are visible to the owner.
|
8
|
-
#
|
7
|
+
# * +messages+ - Messages that were composed and are visible to the owner.
|
8
|
+
# Mesages may have been sent or unsent.
|
9
|
+
# * +received_messages - Messages that have been received from others and
|
10
|
+
# are visible. Messages may have been read or unread.
|
9
11
|
#
|
10
12
|
# == Creating new messages
|
11
13
|
#
|
12
|
-
# To create a new message, the +messages+ association should be used,
|
14
|
+
# To create a new message, the +messages+ association should be used,
|
15
|
+
# for example:
|
13
16
|
#
|
14
17
|
# user = User.find(123)
|
15
18
|
# message = user.messages.build
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'config/boot'
|
2
|
-
require "#{File.dirname(__FILE__)}/../../../../plugins_plus/boot"
|
3
2
|
|
4
3
|
Rails::Initializer.run do |config|
|
5
4
|
config.plugin_paths << '..'
|
6
|
-
config.plugins = %w(
|
5
|
+
config.plugins = %w(state_machine has_messages)
|
7
6
|
config.cache_classes = false
|
8
7
|
config.whiny_nils = true
|
8
|
+
config.action_controller.session = {:key => 'rails_session', :secret => 'd229e4d22437432705ab3985d4d246'}
|
9
9
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
class MigrateHasMessagesToVersion2 < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
|
3
|
+
ActiveRecord::Migrator.new(:up, "#{Rails.root}/../../db/migrate", 0).migrations.each do |migration|
|
4
|
+
migration.migrate(:up)
|
5
|
+
end
|
4
6
|
end
|
5
7
|
|
6
8
|
def self.down
|
7
|
-
|
9
|
+
ActiveRecord::Migrator.new(:up, "#{Rails.root}/../../db/migrate", 0).migrations.each do |migration|
|
10
|
+
migration.migrate(:down)
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
2
2
|
|
3
|
-
class UserByDefaultTest <
|
3
|
+
class UserByDefaultTest < ActiveSupport::TestCase
|
4
4
|
def setup
|
5
5
|
@user = create_user
|
6
6
|
end
|
@@ -22,7 +22,7 @@ class UserByDefaultTest < Test::Unit::TestCase
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
class UserTest <
|
25
|
+
class UserTest < ActiveSupport::TestCase
|
26
26
|
def setup
|
27
27
|
@user = create_user
|
28
28
|
end
|
@@ -40,7 +40,7 @@ class UserTest < Test::Unit::TestCase
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
class UserWithUnsentMessages <
|
43
|
+
class UserWithUnsentMessages < ActiveSupport::TestCase
|
44
44
|
def setup
|
45
45
|
@user = create_user
|
46
46
|
@sent_message = create_message(:sender => @user, :to => create_user(:login => 'you'))
|
@@ -58,7 +58,7 @@ class UserWithUnsentMessages < Test::Unit::TestCase
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
class UserWithSentMessages <
|
61
|
+
class UserWithSentMessages < ActiveSupport::TestCase
|
62
62
|
def setup
|
63
63
|
@user = create_user
|
64
64
|
@to = create_user(:login => 'you')
|
@@ -80,7 +80,7 @@ class UserWithSentMessages < Test::Unit::TestCase
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
class UserWithReceivedMessages <
|
83
|
+
class UserWithReceivedMessages < ActiveSupport::TestCase
|
84
84
|
def setup
|
85
85
|
@sender = create_user
|
86
86
|
@user = create_user(:login => 'me')
|
@@ -99,7 +99,7 @@ class UserWithReceivedMessages < Test::Unit::TestCase
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
class UserWithHiddenMessagesTest <
|
102
|
+
class UserWithHiddenMessagesTest < ActiveSupport::TestCase
|
103
103
|
def setup
|
104
104
|
@user = create_user
|
105
105
|
@friend = create_user(:login => 'you')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
2
2
|
|
3
|
-
class MessageRecipientByDefaultTest <
|
3
|
+
class MessageRecipientByDefaultTest < ActiveSupport::TestCase
|
4
4
|
def setup
|
5
5
|
@recipient = MessageRecipient.new
|
6
6
|
end
|
@@ -35,7 +35,7 @@ class MessageRecipientByDefaultTest < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
class MesageRecipientTest <
|
38
|
+
class MesageRecipientTest < ActiveSupport::TestCase
|
39
39
|
def test_should_be_valid_with_a_set_of_valid_attributes
|
40
40
|
recipient = new_message_recipient
|
41
41
|
assert recipient.valid?
|
@@ -99,7 +99,7 @@ class MesageRecipientTest < Test::Unit::TestCase
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
class MessageRecipientAfterBeingCreatedTest <
|
102
|
+
class MessageRecipientAfterBeingCreatedTest < ActiveSupport::TestCase
|
103
103
|
def setup
|
104
104
|
@admin = create_user(:login => 'admin')
|
105
105
|
@erich = create_user(:login => 'Erich')
|
@@ -157,7 +157,7 @@ class MessageRecipientAfterBeingCreatedTest < Test::Unit::TestCase
|
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
160
|
-
class MessageRecipientOfMultipleTest <
|
160
|
+
class MessageRecipientOfMultipleTest < ActiveSupport::TestCase
|
161
161
|
def setup
|
162
162
|
@erich = create_user(:login => 'Erich')
|
163
163
|
@richard = create_user(:login => 'Richard')
|
@@ -176,7 +176,7 @@ class MessageRecipientOfMultipleTest < Test::Unit::TestCase
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
-
class MessageRecipientUnreadWithUnsentMessageTest <
|
179
|
+
class MessageRecipientUnreadWithUnsentMessageTest < ActiveSupport::TestCase
|
180
180
|
def setup
|
181
181
|
@recipient = create_message_recipient
|
182
182
|
end
|
@@ -190,7 +190,7 @@ class MessageRecipientUnreadWithUnsentMessageTest < Test::Unit::TestCase
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
-
class MessageRecipientUnreadWithSentMessageTest <
|
193
|
+
class MessageRecipientUnreadWithSentMessageTest < ActiveSupport::TestCase
|
194
194
|
def setup
|
195
195
|
@recipient = create_message_recipient
|
196
196
|
@recipient.message.deliver
|
@@ -205,7 +205,7 @@ class MessageRecipientUnreadWithSentMessageTest < Test::Unit::TestCase
|
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
208
|
-
class MessageRecipientReadTest <
|
208
|
+
class MessageRecipientReadTest < ActiveSupport::TestCase
|
209
209
|
def setup
|
210
210
|
@recipient = create_message_recipient
|
211
211
|
@recipient.message.deliver
|
@@ -221,7 +221,7 @@ class MessageRecipientReadTest < Test::Unit::TestCase
|
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
224
|
-
class MessageRecipientHiddenTest <
|
224
|
+
class MessageRecipientHiddenTest < ActiveSupport::TestCase
|
225
225
|
def setup
|
226
226
|
@recipient = create_message_recipient
|
227
227
|
@recipient.hide
|
@@ -240,7 +240,7 @@ class MessageRecipientHiddenTest < Test::Unit::TestCase
|
|
240
240
|
end
|
241
241
|
end
|
242
242
|
|
243
|
-
class MessageRecipientUnhiddenTest <
|
243
|
+
class MessageRecipientUnhiddenTest < ActiveSupport::TestCase
|
244
244
|
def setup
|
245
245
|
@recipient = create_message_recipient
|
246
246
|
@recipient.hide
|
@@ -260,7 +260,7 @@ class MessageRecipientUnhiddenTest < Test::Unit::TestCase
|
|
260
260
|
end
|
261
261
|
end
|
262
262
|
|
263
|
-
class MessageRecipientForwardedTest <
|
263
|
+
class MessageRecipientForwardedTest < ActiveSupport::TestCase
|
264
264
|
def setup
|
265
265
|
@erich = create_user(:login => 'Erich')
|
266
266
|
original_message = create_message(
|
@@ -309,7 +309,7 @@ class MessageRecipientForwardedTest < Test::Unit::TestCase
|
|
309
309
|
end
|
310
310
|
end
|
311
311
|
|
312
|
-
class MessageRecipientRepliedTest <
|
312
|
+
class MessageRecipientRepliedTest < ActiveSupport::TestCase
|
313
313
|
def setup
|
314
314
|
@erich = create_user(:login => 'Erich')
|
315
315
|
@john = create_user(:login => 'John')
|
@@ -360,7 +360,7 @@ class MessageRecipientRepliedTest < Test::Unit::TestCase
|
|
360
360
|
end
|
361
361
|
end
|
362
362
|
|
363
|
-
class MessageRecipientRepliedToAllTest <
|
363
|
+
class MessageRecipientRepliedToAllTest < ActiveSupport::TestCase
|
364
364
|
def setup
|
365
365
|
@erich = create_user(:login => 'Erich')
|
366
366
|
@john = create_user(:login => 'John')
|
@@ -413,7 +413,7 @@ class MessageRecipientRepliedToAllTest < Test::Unit::TestCase
|
|
413
413
|
end
|
414
414
|
end
|
415
415
|
|
416
|
-
class MessageRecipientAfterBeingDestroyedTest <
|
416
|
+
class MessageRecipientAfterBeingDestroyedTest < ActiveSupport::TestCase
|
417
417
|
def setup
|
418
418
|
message = create_message
|
419
419
|
@first_recipient = create_message_recipient(
|
@@ -436,7 +436,7 @@ class MessageRecipientAfterBeingDestroyedTest < Test::Unit::TestCase
|
|
436
436
|
end
|
437
437
|
end
|
438
438
|
|
439
|
-
class MessageRecipientAsAClassTest <
|
439
|
+
class MessageRecipientAsAClassTest < ActiveSupport::TestCase
|
440
440
|
def setup
|
441
441
|
message = create_message
|
442
442
|
@hidden_recipient = create_message_recipient(:message => message, :receiver => create_user(:login => 'erich'), :hidden_at => Time.now)
|
data/test/unit/message_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
2
2
|
|
3
|
-
class MessageByDefaultTest <
|
3
|
+
class MessageByDefaultTest < ActiveSupport::TestCase
|
4
4
|
def setup
|
5
5
|
@message = Message.new
|
6
6
|
end
|
@@ -27,7 +27,7 @@ class MessageByDefaultTest < Test::Unit::TestCase
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
class MessageTest <
|
30
|
+
class MessageTest < ActiveSupport::TestCase
|
31
31
|
def test_should_be_valid_with_a_set_of_valid_attributes
|
32
32
|
message = new_message
|
33
33
|
assert message.valid?
|
@@ -88,7 +88,7 @@ class MessageTest < Test::Unit::TestCase
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
class MessageBeforeBeingCreatedTest <
|
91
|
+
class MessageBeforeBeingCreatedTest < ActiveSupport::TestCase
|
92
92
|
def setup
|
93
93
|
@message = new_message
|
94
94
|
end
|
@@ -128,7 +128,7 @@ class MessageBeforeBeingCreatedTest < Test::Unit::TestCase
|
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
|
-
class MesageAfterBeingCreatedTest <
|
131
|
+
class MesageAfterBeingCreatedTest < ActiveSupport::TestCase
|
132
132
|
def setup
|
133
133
|
@message = create_message
|
134
134
|
end
|
@@ -176,7 +176,7 @@ class MesageAfterBeingCreatedTest < Test::Unit::TestCase
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
-
class MessageWithoutRecipientsTest <
|
179
|
+
class MessageWithoutRecipientsTest < ActiveSupport::TestCase
|
180
180
|
def setup
|
181
181
|
@message = create_message
|
182
182
|
end
|
@@ -190,7 +190,7 @@ class MessageWithoutRecipientsTest < Test::Unit::TestCase
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
-
class MessageWithRecipientsTest <
|
193
|
+
class MessageWithRecipientsTest < ActiveSupport::TestCase
|
194
194
|
def setup
|
195
195
|
@erich = create_user(:login => 'Erich')
|
196
196
|
@richard = create_user(:login => 'Richard')
|
@@ -227,7 +227,7 @@ class MessageWithRecipientsTest < Test::Unit::TestCase
|
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
|
-
class MessageQueuedTest <
|
230
|
+
class MessageQueuedTest < ActiveSupport::TestCase
|
231
231
|
def setup
|
232
232
|
@message = create_message(:to => create_user(:login => 'coward'))
|
233
233
|
@message.queue
|
@@ -246,7 +246,7 @@ class MessageQueuedTest < Test::Unit::TestCase
|
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
|
-
class MessageDeliveredTest <
|
249
|
+
class MessageDeliveredTest < ActiveSupport::TestCase
|
250
250
|
def setup
|
251
251
|
@message = create_message(:to => create_user(:login => 'coward'))
|
252
252
|
@message.deliver
|
@@ -265,7 +265,7 @@ class MessageDeliveredTest < Test::Unit::TestCase
|
|
265
265
|
end
|
266
266
|
end
|
267
267
|
|
268
|
-
class MessageHiddenTest <
|
268
|
+
class MessageHiddenTest < ActiveSupport::TestCase
|
269
269
|
def setup
|
270
270
|
@message = create_message
|
271
271
|
@message.hide
|
@@ -284,7 +284,7 @@ class MessageHiddenTest < Test::Unit::TestCase
|
|
284
284
|
end
|
285
285
|
end
|
286
286
|
|
287
|
-
class MessageUnhiddenTest <
|
287
|
+
class MessageUnhiddenTest < ActiveSupport::TestCase
|
288
288
|
def setup
|
289
289
|
@message = create_message
|
290
290
|
@message.hide
|
@@ -304,7 +304,7 @@ class MessageUnhiddenTest < Test::Unit::TestCase
|
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
307
|
-
class MessageForwardedTest <
|
307
|
+
class MessageForwardedTest < ActiveSupport::TestCase
|
308
308
|
def setup
|
309
309
|
@admin = create_user(:login => 'admin')
|
310
310
|
original_message = create_message(
|
@@ -351,7 +351,7 @@ class MessageForwardedTest < Test::Unit::TestCase
|
|
351
351
|
end
|
352
352
|
end
|
353
353
|
|
354
|
-
class MessageRepliedTest <
|
354
|
+
class MessageRepliedTest < ActiveSupport::TestCase
|
355
355
|
def setup
|
356
356
|
@admin = create_user(:login => 'admin')
|
357
357
|
@erich = create_user(:login => 'Erich')
|
@@ -402,7 +402,7 @@ class MessageRepliedTest < Test::Unit::TestCase
|
|
402
402
|
end
|
403
403
|
end
|
404
404
|
|
405
|
-
class MessageRepliedToAllTest <
|
405
|
+
class MessageRepliedToAllTest < ActiveSupport::TestCase
|
406
406
|
def setup
|
407
407
|
@admin = create_user(:login => 'admin')
|
408
408
|
@erich = create_user(:login => 'Erich')
|
@@ -453,7 +453,7 @@ class MessageRepliedToAllTest < Test::Unit::TestCase
|
|
453
453
|
end
|
454
454
|
end
|
455
455
|
|
456
|
-
class MessageAsAClassTest <
|
456
|
+
class MessageAsAClassTest < ActiveSupport::TestCase
|
457
457
|
def setup
|
458
458
|
@hidden_message = create_message(:hidden_at => Time.now)
|
459
459
|
@visible_message = create_message
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_messages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Pfeifer
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-19 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
23
|
+
version: 0.7.0
|
24
24
|
version:
|
25
25
|
description:
|
26
26
|
email: aaron@pluginaweek.org
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
requirements: []
|
83
83
|
|
84
84
|
rubyforge_project: pluginaweek
|
85
|
-
rubygems_version: 1.
|
85
|
+
rubygems_version: 1.3.1
|
86
86
|
signing_key:
|
87
87
|
specification_version: 2
|
88
88
|
summary: Demonstrates a reference implementation for sending messages between users.
|