mailboxer 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +90 -77
- data/app/models/conversation.rb +2 -2
- data/app/models/message.rb +2 -2
- data/app/models/notification.rb +5 -5
- data/app/models/receipt.rb +7 -7
- data/db/migrate/20111204163911_add_attachments.rb +5 -1
- data/db/migrate/20120813110712_rename_receipts_read.rb +9 -0
- data/lib/mailboxer/models/messageable.rb +5 -5
- data/mailboxer.gemspec +7 -6
- data/spec/dummy/db/migrate/20120813110712_rename_receipts_read.rb +9 -0
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/integration/message_and_receipt_spec.rb +26 -26
- data/spec/models/mailboxer_models_messageable_spec.rb +56 -56
- data/spec/models/notification_spec.rb +19 -1
- data/spec/models/receipt_spec.rb +4 -4
- metadata +125 -145
@@ -41,7 +41,8 @@ describe Message do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should notify several users" do
|
44
|
-
|
44
|
+
recipients = Set.new [@entity1,@entity2,@entity3]
|
45
|
+
Notification.notify_all(recipients,"Subject","Body")
|
45
46
|
|
46
47
|
#Check getting ALL receipts
|
47
48
|
@entity1.mailbox.receipts.size.should==1
|
@@ -76,4 +77,21 @@ describe Message do
|
|
76
77
|
|
77
78
|
end
|
78
79
|
|
80
|
+
it "should notify a single recipient" do
|
81
|
+
Notification.notify_all(@entity1,"Subject","Body")
|
82
|
+
|
83
|
+
#Check getting ALL receipts
|
84
|
+
@entity1.mailbox.receipts.size.should==1
|
85
|
+
receipt = @entity1.mailbox.receipts.first
|
86
|
+
notification = receipt.notification
|
87
|
+
notification.subject.should=="Subject"
|
88
|
+
notification.body.should=="Body"
|
89
|
+
|
90
|
+
#Check getting NOTIFICATION receipts only
|
91
|
+
@entity1.mailbox.notifications.size.should==1
|
92
|
+
notification = @entity1.mailbox.notifications.first
|
93
|
+
notification.subject.should=="Subject"
|
94
|
+
notification.body.should=="Body"
|
95
|
+
end
|
96
|
+
|
79
97
|
end
|
data/spec/models/receipt_spec.rb
CHANGED
@@ -17,16 +17,16 @@ describe Receipt do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should be able to be marked as unread" do
|
20
|
-
@mail1.
|
20
|
+
@mail1.is_read.should==true
|
21
21
|
@mail1.mark_as_unread
|
22
|
-
@mail1.
|
22
|
+
@mail1.is_read.should==false
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should be able to be marked as read" do
|
26
|
-
@mail1.
|
26
|
+
@mail1.is_read.should==true
|
27
27
|
@mail1.mark_as_unread
|
28
28
|
@mail1.mark_as_read
|
29
|
-
@mail1.
|
29
|
+
@mail1.is_read.should==true
|
30
30
|
end
|
31
31
|
|
32
32
|
|
metadata
CHANGED
@@ -1,173 +1,155 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailboxer
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 7
|
9
|
-
- 0
|
10
|
-
version: 0.7.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Eduardo Casanova Cuesta
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: foreigner
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 57
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 9
|
32
|
-
- 1
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.9.1
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rails
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.9.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rails
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
40
33
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 7
|
45
|
-
segments:
|
46
|
-
- 3
|
47
|
-
- 0
|
48
|
-
- 0
|
34
|
+
requirements:
|
35
|
+
- - ! '>'
|
36
|
+
- !ruby/object:Gem::Version
|
49
37
|
version: 3.0.0
|
50
38
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: carrierwave
|
54
39
|
prerelease: false
|
55
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>'
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: carrierwave
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
56
49
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
hash: 27
|
61
|
-
segments:
|
62
|
-
- 0
|
63
|
-
- 5
|
64
|
-
- 8
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
65
53
|
version: 0.5.8
|
66
54
|
type: :runtime
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: ruby-debug
|
70
55
|
prerelease: false
|
71
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
57
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
|
78
|
-
- 0
|
79
|
-
- 10
|
80
|
-
- 3
|
81
|
-
version: 0.10.3
|
82
|
-
type: :development
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.5.8
|
62
|
+
- !ruby/object:Gem::Dependency
|
85
63
|
name: rspec-rails
|
86
|
-
|
87
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
88
65
|
none: false
|
89
|
-
requirements:
|
90
|
-
- -
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
hash: 21
|
93
|
-
segments:
|
94
|
-
- 2
|
95
|
-
- 6
|
96
|
-
- 1
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
97
69
|
version: 2.6.1
|
98
70
|
type: :development
|
99
|
-
version_requirements: *id005
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: factory_girl
|
102
71
|
prerelease: false
|
103
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.6.1
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: factory_girl
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
104
81
|
none: false
|
105
|
-
requirements:
|
82
|
+
requirements:
|
106
83
|
- - ~>
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
hash: 23
|
109
|
-
segments:
|
110
|
-
- 2
|
111
|
-
- 6
|
112
|
-
- 0
|
84
|
+
- !ruby/object:Gem::Version
|
113
85
|
version: 2.6.0
|
114
86
|
type: :development
|
115
|
-
version_requirements: *id006
|
116
|
-
- !ruby/object:Gem::Dependency
|
117
|
-
name: forgery
|
118
87
|
prerelease: false
|
119
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.6.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: forgery
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
120
97
|
none: false
|
121
|
-
requirements:
|
122
|
-
- -
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
hash: 31
|
125
|
-
segments:
|
126
|
-
- 0
|
127
|
-
- 3
|
128
|
-
- 6
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
129
101
|
version: 0.3.6
|
130
102
|
type: :development
|
131
|
-
version_requirements: *id007
|
132
|
-
- !ruby/object:Gem::Dependency
|
133
|
-
name: capybara
|
134
103
|
prerelease: false
|
135
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
105
|
none: false
|
137
|
-
requirements:
|
138
|
-
- -
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.3.6
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: capybara
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
145
117
|
version: 0.3.9
|
146
118
|
type: :development
|
147
|
-
version_requirements: *id008
|
148
|
-
- !ruby/object:Gem::Dependency
|
149
|
-
name: sqlite3-ruby
|
150
119
|
prerelease: false
|
151
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
152
121
|
none: false
|
153
|
-
requirements:
|
154
|
-
- -
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.3.9
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: sqlite3-ruby
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
160
134
|
type: :development
|
161
|
-
|
162
|
-
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: A Rails engine that allows any model to act as messageable, adding the
|
143
|
+
ability to exchange messages with any other messageable model, even different ones.
|
144
|
+
It supports the use of conversations with two or more recipients to organize the
|
145
|
+
messages. You have a complete use of a mailbox object for each messageable model
|
146
|
+
that manages an inbox, sentbox and trash for conversations. It also supports sending
|
147
|
+
notifications to messageable models, intended to be used as system notifications.
|
163
148
|
email: ecasanovac@gmail.com
|
164
149
|
executables: []
|
165
|
-
|
166
150
|
extensions: []
|
167
|
-
|
168
151
|
extra_rdoc_files: []
|
169
|
-
|
170
|
-
files:
|
152
|
+
files:
|
171
153
|
- .gitignore
|
172
154
|
- .rspec
|
173
155
|
- .travis.yml
|
@@ -195,6 +177,7 @@ files:
|
|
195
177
|
- db/migrate/20110719110700_add_notified_object.rb
|
196
178
|
- db/migrate/20110912163911_add_notification_code.rb
|
197
179
|
- db/migrate/20111204163911_add_attachments.rb
|
180
|
+
- db/migrate/20120813110712_rename_receipts_read.rb
|
198
181
|
- lib/generators/mailboxer/install_generator.rb
|
199
182
|
- lib/generators/mailboxer/templates/initializer.rb
|
200
183
|
- lib/generators/mailboxer/views_generator.rb
|
@@ -240,6 +223,7 @@ files:
|
|
240
223
|
- spec/dummy/db/migrate/20120305103201_add_notified_object.rb
|
241
224
|
- spec/dummy/db/migrate/20120305103202_add_notification_code.rb
|
242
225
|
- spec/dummy/db/migrate/20120305103203_add_attachments.rb
|
226
|
+
- spec/dummy/db/migrate/20120813110712_rename_receipts_read.rb
|
243
227
|
- spec/dummy/db/schema.rb
|
244
228
|
- spec/dummy/public/404.html
|
245
229
|
- spec/dummy/public/422.html
|
@@ -268,36 +252,32 @@ files:
|
|
268
252
|
- spec/testfile.txt
|
269
253
|
homepage: https://github.com/ging/mailboxer
|
270
254
|
licenses: []
|
271
|
-
|
272
255
|
post_install_message:
|
273
256
|
rdoc_options: []
|
274
|
-
|
275
|
-
require_paths:
|
257
|
+
require_paths:
|
276
258
|
- lib
|
277
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
259
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
278
260
|
none: false
|
279
|
-
requirements:
|
280
|
-
- -
|
281
|
-
- !ruby/object:Gem::Version
|
282
|
-
|
283
|
-
segments:
|
261
|
+
requirements:
|
262
|
+
- - ! '>='
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
265
|
+
segments:
|
284
266
|
- 0
|
285
|
-
|
286
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
|
+
hash: 2240527445875672830
|
268
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
269
|
none: false
|
288
|
-
requirements:
|
289
|
-
- -
|
290
|
-
- !ruby/object:Gem::Version
|
291
|
-
|
292
|
-
segments:
|
270
|
+
requirements:
|
271
|
+
- - ! '>='
|
272
|
+
- !ruby/object:Gem::Version
|
273
|
+
version: '0'
|
274
|
+
segments:
|
293
275
|
- 0
|
294
|
-
|
276
|
+
hash: 2240527445875672830
|
295
277
|
requirements: []
|
296
|
-
|
297
278
|
rubyforge_project:
|
298
|
-
rubygems_version: 1.8.
|
279
|
+
rubygems_version: 1.8.23
|
299
280
|
signing_key:
|
300
281
|
specification_version: 3
|
301
282
|
summary: Messaging system for rails apps.
|
302
283
|
test_files: []
|
303
|
-
|