mailboxer 0.12.4 → 0.12.5
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.
- checksums.yaml +4 -4
- data/.travis.yml +15 -3
- data/app/models/mailboxer/receipt.rb +4 -11
- data/gemfiles/rails4.2.gemfile +7 -0
- data/lib/generators/mailboxer/views_generator.rb +2 -2
- data/lib/mailboxer/mail_dispatcher.rb +2 -2
- data/lib/mailboxer/version.rb +1 -1
- data/mailboxer.gemspec +3 -1
- data/spec/dummy/config/application.rb +5 -0
- data/spec/integration/message_and_receipt_spec.rb +208 -208
- data/spec/integration/navigation_spec.rb +2 -3
- data/spec/mailboxer/mail_dispatcher_spec.rb +10 -10
- data/spec/mailboxer_spec.rb +1 -1
- data/spec/mailers/message_mailer_spec.rb +10 -10
- data/spec/mailers/notification_mailer_spec.rb +4 -5
- data/spec/models/conversation_spec.rb +27 -27
- data/spec/models/mailbox_spec.rb +56 -56
- data/spec/models/mailboxer_models_messageable_spec.rb +73 -73
- data/spec/models/message_spec.rb +10 -10
- data/spec/models/notification_spec.rb +60 -60
- data/spec/models/receipt_spec.rb +16 -17
- data/spec/spec_helper.rb +8 -0
- metadata +59 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d3dc85202d707157141672e526db6f126cd6969
|
4
|
+
data.tar.gz: dcfd20e099d3355a6c3f0ccc8cc7817ff05262b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 339eb28db3520ce5fd59ba8898358aecd98afbd98d644dfeb1f09e4f9f0a7052e6168e5cf492e79c7ffb1bd9849daaaec68faf3a35cbcdfa36ff6f3b15862d8d
|
7
|
+
data.tar.gz: d8dabb5d52bc1a7f108e96d00e7eb4ee2f62b1d93b630660f8461d733ec384591fa853277d0810efccd3763e5466533377fc1c3d1bb5bd21d33bf501f1a68ed7
|
data/.travis.yml
CHANGED
@@ -1,12 +1,24 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: false
|
4
|
+
|
2
5
|
rvm:
|
3
|
-
- 1.
|
4
|
-
|
5
|
-
|
6
|
+
- 2.1.4
|
7
|
+
|
8
|
+
matrix:
|
9
|
+
include:
|
10
|
+
- rvm: 1.9.3
|
11
|
+
gemfile: gemfiles/rails4.1.gemfile
|
12
|
+
- rvm: 2.0
|
13
|
+
gemfile: gemfiles/rails4.1.gemfile
|
14
|
+
- rvm: jruby-19mode
|
15
|
+
gemfile: gemfiles/rails4.1.gemfile
|
16
|
+
|
6
17
|
gemfile:
|
7
18
|
- gemfiles/rails3.2.gemfile
|
8
19
|
- gemfiles/rails4.0.gemfile
|
9
20
|
- gemfiles/rails4.1.gemfile
|
21
|
+
- gemfiles/rails4.2.gemfile
|
10
22
|
env:
|
11
23
|
global:
|
12
24
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
@@ -72,19 +72,12 @@ class Mailboxer::Receipt < ActiveRecord::Base
|
|
72
72
|
update_receipts({:mailbox_type => :sentbox, :trashed => false}, options)
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
#According to the github ticket https://github.com/rails/rails/issues/522 it should be
|
77
|
-
#supported with 3.2.
|
78
|
-
def update_receipts(updates,options={})
|
75
|
+
def update_receipts(updates, options={})
|
79
76
|
ids = where(options).map { |rcp| rcp.id }
|
80
77
|
unless ids.empty?
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
condition << "OR id = ? "
|
85
|
-
end
|
86
|
-
conditions[0] = condition
|
87
|
-
Mailboxer::Receipt.except(:where).except(:joins).where(conditions).update_all(updates)
|
78
|
+
sql = ids.map { "#{table_name}.id = ? " }.join(' OR ')
|
79
|
+
conditions = [sql].concat(ids)
|
80
|
+
Mailboxer::Receipt.where(conditions).update_all(updates)
|
88
81
|
end
|
89
82
|
end
|
90
83
|
end
|
@@ -3,7 +3,7 @@ class Mailboxer::ViewsGenerator < Rails::Generators::Base
|
|
3
3
|
|
4
4
|
desc "Copy Mailboxer views into your app"
|
5
5
|
def copy_views
|
6
|
-
directory('message_mailer', 'app/views/message_mailer')
|
7
|
-
directory('notification_mailer', 'app/views/notification_mailer')
|
6
|
+
directory('message_mailer', 'app/views/mailboxer/message_mailer')
|
7
|
+
directory('notification_mailer', 'app/views/mailboxer/notification_mailer')
|
8
8
|
end
|
9
9
|
end
|
@@ -40,9 +40,9 @@ module Mailboxer
|
|
40
40
|
if Mailboxer.custom_deliver_proc
|
41
41
|
Mailboxer.custom_deliver_proc.call(mailer, mailable, recipient)
|
42
42
|
else
|
43
|
-
mailer.send_email(mailable, recipient)
|
43
|
+
email = mailer.send_email(mailable, recipient)
|
44
|
+
email.respond_to?(:deliver_now) ? email.deliver_now : email.deliver
|
44
45
|
end
|
45
46
|
end
|
46
|
-
|
47
47
|
end
|
48
48
|
end
|
data/lib/mailboxer/version.rb
CHANGED
data/mailboxer.gemspec
CHANGED
@@ -33,7 +33,9 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency 'racc'
|
34
34
|
end
|
35
35
|
# Specs
|
36
|
-
s.add_development_dependency 'rspec-rails', '~>
|
36
|
+
s.add_development_dependency 'rspec-rails', '~> 3.0'
|
37
|
+
s.add_development_dependency 'rspec-its', '~> 1.1'
|
38
|
+
s.add_development_dependency 'rspec-collection_matchers', '~> 1.1'
|
37
39
|
s.add_development_dependency('appraisal', '~> 1.0.0')
|
38
40
|
s.add_development_dependency('shoulda-matchers')
|
39
41
|
# Fixtures
|
@@ -7,6 +7,9 @@ require "mailboxer"
|
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
10
|
+
def rails_more_than_4_2?
|
11
|
+
Gem::Version.new(Rails.version) >= Gem::Version.new('4.2.0')
|
12
|
+
end
|
10
13
|
# Settings in config/environments/* take precedence over those specified here.
|
11
14
|
# Application configuration should go into files in config/initializers
|
12
15
|
# -- all .rb files in that directory are automatically loaded.
|
@@ -37,6 +40,8 @@ module Dummy
|
|
37
40
|
|
38
41
|
# Configure sensitive parameters which will be filtered from the log file.
|
39
42
|
config.filter_parameters += [:password]
|
43
|
+
config.active_record.raise_in_transactional_callbacks = true if rails_more_than_4_2?
|
44
|
+
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe "Messages And Mailboxer::Receipts" do
|
3
|
+
describe "Messages And Mailboxer::Receipts", type: :integration do
|
4
4
|
|
5
5
|
describe "two equal entities" do
|
6
6
|
before do
|
@@ -16,8 +16,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should create proper message" do
|
19
|
-
@message1.sender.id.
|
20
|
-
@message1.sender.class.
|
19
|
+
expect(@message1.sender.id).to eq @entity1.id
|
20
|
+
expect(@message1.sender.class).to eq @entity1.class
|
21
21
|
assert @message1.body.eql?"Body"
|
22
22
|
assert @message1.subject.eql?"Subject"
|
23
23
|
end
|
@@ -27,25 +27,25 @@ describe "Messages And Mailboxer::Receipts" do
|
|
27
27
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message1).first
|
28
28
|
assert mail
|
29
29
|
if mail
|
30
|
-
mail.is_read.
|
31
|
-
mail.trashed.
|
32
|
-
mail.mailbox_type.
|
30
|
+
expect(mail.is_read).to be true
|
31
|
+
expect(mail.trashed).to be false
|
32
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
33
33
|
end
|
34
34
|
#Receiver Mail
|
35
35
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message1).first
|
36
36
|
assert mail
|
37
37
|
if mail
|
38
|
-
mail.is_read.
|
39
|
-
mail.trashed.
|
40
|
-
mail.mailbox_type.
|
38
|
+
expect(mail.is_read).to be false
|
39
|
+
expect(mail.trashed).to be false
|
40
|
+
expect(mail.mailbox_type).to eq "inbox"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should have the correct recipients" do
|
45
45
|
recipients = @message1.recipients
|
46
|
-
recipients.count.
|
47
|
-
recipients.count(@entity1).
|
48
|
-
recipients.count(@entity2).
|
46
|
+
expect(recipients.count).to eq 2
|
47
|
+
expect(recipients.count(@entity1)).to eq 1
|
48
|
+
expect(recipients.count(@entity2)).to eq 1
|
49
49
|
end
|
50
50
|
|
51
51
|
end
|
@@ -59,10 +59,10 @@ describe "Messages And Mailboxer::Receipts" do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should create proper message" do
|
62
|
-
@message2.sender.id.
|
63
|
-
@message2.sender.class.
|
64
|
-
@message2.body.
|
65
|
-
@message2.subject.
|
62
|
+
expect(@message2.sender.id).to eq @entity2.id
|
63
|
+
expect(@message2.sender.class).to eq @entity2.class
|
64
|
+
expect(@message2.body).to eq "Reply body"
|
65
|
+
expect(@message2.subject).to eq "Subject"
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should create proper mails" do
|
@@ -70,29 +70,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
70
70
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
71
71
|
assert mail
|
72
72
|
if mail
|
73
|
-
mail.is_read.
|
74
|
-
mail.trashed.
|
75
|
-
mail.mailbox_type.
|
73
|
+
expect(mail.is_read).to be true
|
74
|
+
expect(mail.trashed).to be false
|
75
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
76
76
|
end
|
77
77
|
#Receiver Mail
|
78
78
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
79
79
|
assert mail
|
80
80
|
if mail
|
81
|
-
mail.is_read.
|
82
|
-
mail.trashed.
|
83
|
-
mail.mailbox_type.
|
81
|
+
expect(mail.is_read).to be false
|
82
|
+
expect(mail.trashed).to be false
|
83
|
+
expect(mail.mailbox_type).to eq "inbox"
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
it "should have the correct recipients" do
|
88
88
|
recipients = @message2.recipients
|
89
|
-
recipients.count.
|
90
|
-
recipients.count(@entity1).
|
91
|
-
recipients.count(@entity2).
|
89
|
+
expect(recipients.count).to eq 2
|
90
|
+
expect(recipients.count(@entity1)).to eq 1
|
91
|
+
expect(recipients.count(@entity2)).to eq 1
|
92
92
|
end
|
93
93
|
|
94
94
|
it "should be associated to the same conversation" do
|
95
|
-
@message1.conversation.id.
|
95
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -105,8 +105,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
105
105
|
end
|
106
106
|
|
107
107
|
it "should create proper message" do
|
108
|
-
@message2.sender.id.
|
109
|
-
@message2.sender.class.
|
108
|
+
expect(@message2.sender.id).to eq @entity2.id
|
109
|
+
expect(@message2.sender.class).to eq @entity2.class
|
110
110
|
assert @message2.body.eql?"Reply body"
|
111
111
|
assert @message2.subject.eql?"Subject"
|
112
112
|
end
|
@@ -116,29 +116,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
116
116
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
117
117
|
assert mail
|
118
118
|
if mail
|
119
|
-
mail.is_read.
|
120
|
-
mail.trashed.
|
121
|
-
mail.mailbox_type.
|
119
|
+
expect(mail.is_read).to be true
|
120
|
+
expect(mail.trashed).to be false
|
121
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
122
122
|
end
|
123
123
|
#Receiver Mail
|
124
124
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
125
125
|
assert mail
|
126
126
|
if mail
|
127
|
-
mail.is_read.
|
128
|
-
mail.trashed.
|
129
|
-
mail.mailbox_type.
|
127
|
+
expect(mail.is_read).to be false
|
128
|
+
expect(mail.trashed).to be false
|
129
|
+
expect(mail.mailbox_type).to eq "inbox"
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
133
|
it "should have the correct recipients" do
|
134
134
|
recipients = @message2.recipients
|
135
|
-
recipients.count.
|
136
|
-
recipients.count(@entity1).
|
137
|
-
recipients.count(@entity2).
|
135
|
+
expect(recipients.count).to eq 2
|
136
|
+
expect(recipients.count(@entity1)).to eq 1
|
137
|
+
expect(recipients.count(@entity2)).to eq 1
|
138
138
|
end
|
139
139
|
|
140
140
|
it "should be associated to the same conversation" do
|
141
|
-
@message1.conversation.id.
|
141
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
142
142
|
end
|
143
143
|
end
|
144
144
|
describe "message replying to conversation" do
|
@@ -150,8 +150,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
150
150
|
end
|
151
151
|
|
152
152
|
it "should create proper message" do
|
153
|
-
@message2.sender.id.
|
154
|
-
@message2.sender.class.
|
153
|
+
expect(@message2.sender.id).to eq @entity2.id
|
154
|
+
expect(@message2.sender.class).to eq @entity2.class
|
155
155
|
assert @message2.body.eql?"Reply body"
|
156
156
|
assert @message2.subject.eql?"Subject"
|
157
157
|
end
|
@@ -161,29 +161,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
161
161
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
162
162
|
assert mail
|
163
163
|
if mail
|
164
|
-
mail.is_read.
|
165
|
-
mail.trashed.
|
166
|
-
mail.mailbox_type.
|
164
|
+
expect(mail.is_read).to be true
|
165
|
+
expect(mail.trashed).to be false
|
166
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
167
167
|
end
|
168
168
|
#Receiver Mail
|
169
169
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
170
170
|
assert mail
|
171
171
|
if mail
|
172
|
-
mail.is_read.
|
173
|
-
mail.trashed.
|
174
|
-
mail.mailbox_type.
|
172
|
+
expect(mail.is_read).to be false
|
173
|
+
expect(mail.trashed).to be false
|
174
|
+
expect(mail.mailbox_type).to eq "inbox"
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
178
|
it "should have the correct recipients" do
|
179
179
|
recipients = @message2.recipients
|
180
|
-
recipients.count.
|
181
|
-
recipients.count(@entity1).
|
182
|
-
recipients.count(@entity2).
|
180
|
+
expect(recipients.count).to eq 2
|
181
|
+
expect(recipients.count(@entity1)).to eq 1
|
182
|
+
expect(recipients.count(@entity2)).to eq 1
|
183
183
|
end
|
184
184
|
|
185
185
|
it "should be associated to the same conversation" do
|
186
|
-
@message1.conversation.id.
|
186
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
187
187
|
end
|
188
188
|
end
|
189
189
|
end
|
@@ -202,8 +202,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
202
202
|
end
|
203
203
|
|
204
204
|
it "should create proper message" do
|
205
|
-
@message1.sender.id.
|
206
|
-
@message1.sender.class.
|
205
|
+
expect(@message1.sender.id).to eq @entity1.id
|
206
|
+
expect(@message1.sender.class).to eq @entity1.class
|
207
207
|
assert @message1.body.eql?"Body"
|
208
208
|
assert @message1.subject.eql?"Subject"
|
209
209
|
end
|
@@ -213,25 +213,25 @@ describe "Messages And Mailboxer::Receipts" do
|
|
213
213
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message1).first
|
214
214
|
assert mail
|
215
215
|
if mail
|
216
|
-
mail.is_read.
|
217
|
-
mail.trashed.
|
218
|
-
mail.mailbox_type.
|
216
|
+
expect(mail.is_read).to be true
|
217
|
+
expect(mail.trashed).to be false
|
218
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
219
219
|
end
|
220
220
|
#Receiver Mail
|
221
221
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message1).first
|
222
222
|
assert mail
|
223
223
|
if mail
|
224
|
-
mail.is_read.
|
225
|
-
mail.trashed.
|
226
|
-
mail.mailbox_type.
|
224
|
+
expect(mail.is_read).to be false
|
225
|
+
expect(mail.trashed).to be false
|
226
|
+
expect(mail.mailbox_type).to eq "inbox"
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
230
|
it "should have the correct recipients" do
|
231
231
|
recipients = @message1.recipients
|
232
|
-
recipients.count.
|
233
|
-
recipients.count(@entity1).
|
234
|
-
recipients.count(@entity2).
|
232
|
+
expect(recipients.count).to eq 2
|
233
|
+
expect(recipients.count(@entity1)).to eq 1
|
234
|
+
expect(recipients.count(@entity2)).to eq 1
|
235
235
|
end
|
236
236
|
|
237
237
|
end
|
@@ -245,8 +245,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
245
245
|
end
|
246
246
|
|
247
247
|
it "should create proper message" do
|
248
|
-
@message2.sender.id.
|
249
|
-
@message2.sender.class.
|
248
|
+
expect(@message2.sender.id).to eq @entity2.id
|
249
|
+
expect(@message2.sender.class).to eq @entity2.class
|
250
250
|
assert @message2.body.eql?"Reply body"
|
251
251
|
assert @message2.subject.eql?"Subject"
|
252
252
|
end
|
@@ -256,29 +256,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
256
256
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
257
257
|
assert mail
|
258
258
|
if mail
|
259
|
-
mail.is_read.
|
260
|
-
mail.trashed.
|
261
|
-
mail.mailbox_type.
|
259
|
+
expect(mail.is_read).to be true
|
260
|
+
expect(mail.trashed).to be false
|
261
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
262
262
|
end
|
263
263
|
#Receiver Mail
|
264
264
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
265
265
|
assert mail
|
266
266
|
if mail
|
267
|
-
mail.is_read.
|
268
|
-
mail.trashed.
|
269
|
-
mail.mailbox_type.
|
267
|
+
expect(mail.is_read).to be false
|
268
|
+
expect(mail.trashed).to be false
|
269
|
+
expect(mail.mailbox_type).to eq "inbox"
|
270
270
|
end
|
271
271
|
end
|
272
272
|
|
273
273
|
it "should have the correct recipients" do
|
274
274
|
recipients = @message2.recipients
|
275
|
-
recipients.count.
|
276
|
-
recipients.count(@entity1).
|
277
|
-
recipients.count(@entity2).
|
275
|
+
expect(recipients.count).to eq 2
|
276
|
+
expect(recipients.count(@entity1)).to eq 1
|
277
|
+
expect(recipients.count(@entity2)).to eq 1
|
278
278
|
end
|
279
279
|
|
280
280
|
it "should be associated to the same conversation" do
|
281
|
-
@message1.conversation.id.
|
281
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
282
282
|
end
|
283
283
|
end
|
284
284
|
|
@@ -291,8 +291,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
291
291
|
end
|
292
292
|
|
293
293
|
it "should create proper message" do
|
294
|
-
@message2.sender.id.
|
295
|
-
@message2.sender.class.
|
294
|
+
expect(@message2.sender.id).to eq @entity2.id
|
295
|
+
expect(@message2.sender.class).to eq @entity2.class
|
296
296
|
assert @message2.body.eql?"Reply body"
|
297
297
|
assert @message2.subject.eql?"Subject"
|
298
298
|
end
|
@@ -302,29 +302,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
302
302
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
303
303
|
assert mail
|
304
304
|
if mail
|
305
|
-
mail.is_read.
|
306
|
-
mail.trashed.
|
307
|
-
mail.mailbox_type.
|
305
|
+
expect(mail.is_read).to be true
|
306
|
+
expect(mail.trashed).to be false
|
307
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
308
308
|
end
|
309
309
|
#Receiver Mail
|
310
310
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
311
311
|
assert mail
|
312
312
|
if mail
|
313
|
-
mail.is_read.
|
314
|
-
mail.trashed.
|
315
|
-
mail.mailbox_type.
|
313
|
+
expect(mail.is_read).to be false
|
314
|
+
expect(mail.trashed).to be false
|
315
|
+
expect(mail.mailbox_type).to eq "inbox"
|
316
316
|
end
|
317
317
|
end
|
318
318
|
|
319
319
|
it "should have the correct recipients" do
|
320
320
|
recipients = @message2.recipients
|
321
|
-
recipients.count.
|
322
|
-
recipients.count(@entity1).
|
323
|
-
recipients.count(@entity2).
|
321
|
+
expect(recipients.count).to eq 2
|
322
|
+
expect(recipients.count(@entity1)).to eq 1
|
323
|
+
expect(recipients.count(@entity2)).to eq 1
|
324
324
|
end
|
325
325
|
|
326
326
|
it "should be associated to the same conversation" do
|
327
|
-
@message1.conversation.id.
|
327
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
328
328
|
end
|
329
329
|
end
|
330
330
|
describe "message replying to conversation (TODO)" do
|
@@ -368,8 +368,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
368
368
|
end
|
369
369
|
|
370
370
|
it "should create proper message" do
|
371
|
-
@message1.sender.id.
|
372
|
-
@message1.sender.class.
|
371
|
+
expect(@message1.sender.id).to eq @entity1.id
|
372
|
+
expect(@message1.sender.class).to eq @entity1.class
|
373
373
|
assert @message1.body.eql?"Body"
|
374
374
|
assert @message1.subject.eql?"Subject"
|
375
375
|
end
|
@@ -379,28 +379,28 @@ describe "Messages And Mailboxer::Receipts" do
|
|
379
379
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message1).first
|
380
380
|
assert mail
|
381
381
|
if mail
|
382
|
-
mail.is_read.
|
383
|
-
mail.trashed.
|
384
|
-
mail.mailbox_type.
|
382
|
+
expect(mail.is_read).to be true
|
383
|
+
expect(mail.trashed).to be false
|
384
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
385
385
|
end
|
386
386
|
#Receiver Mails
|
387
387
|
@recipients.each do |receiver|
|
388
388
|
mail = Mailboxer::Receipt.recipient(receiver).notification(@message1).first
|
389
389
|
assert mail
|
390
390
|
if mail
|
391
|
-
mail.is_read.
|
392
|
-
mail.trashed.
|
393
|
-
mail.mailbox_type.
|
391
|
+
expect(mail.is_read).to be false
|
392
|
+
expect(mail.trashed).to be false
|
393
|
+
expect(mail.mailbox_type).to eq "inbox"
|
394
394
|
end
|
395
395
|
end
|
396
396
|
end
|
397
397
|
|
398
398
|
it "should have the correct recipients" do
|
399
399
|
recipients = @message1.recipients
|
400
|
-
recipients.count.
|
401
|
-
recipients.count(@entity1).
|
402
|
-
recipients.count(@entity2).
|
403
|
-
recipients.count(@entity3).
|
400
|
+
expect(recipients.count).to eq 3
|
401
|
+
expect(recipients.count(@entity1)).to eq 1
|
402
|
+
expect(recipients.count(@entity2)).to eq 1
|
403
|
+
expect(recipients.count(@entity3)).to eq 1
|
404
404
|
end
|
405
405
|
|
406
406
|
end
|
@@ -414,8 +414,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
414
414
|
end
|
415
415
|
|
416
416
|
it "should create proper message" do
|
417
|
-
@message2.sender.id.
|
418
|
-
@message2.sender.class.
|
417
|
+
expect(@message2.sender.id).to eq @entity2.id
|
418
|
+
expect(@message2.sender.class).to eq @entity2.class
|
419
419
|
assert @message2.body.eql?"Reply body"
|
420
420
|
assert @message2.subject.eql?"Subject"
|
421
421
|
end
|
@@ -425,17 +425,17 @@ describe "Messages And Mailboxer::Receipts" do
|
|
425
425
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
426
426
|
assert mail
|
427
427
|
if mail
|
428
|
-
mail.is_read.
|
429
|
-
mail.trashed.
|
430
|
-
mail.mailbox_type.
|
428
|
+
expect(mail.is_read).to be true
|
429
|
+
expect(mail.trashed).to be false
|
430
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
431
431
|
end
|
432
432
|
#Receiver Mail
|
433
433
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
434
434
|
assert mail
|
435
435
|
if mail
|
436
|
-
mail.is_read.
|
437
|
-
mail.trashed.
|
438
|
-
mail.mailbox_type.
|
436
|
+
expect(mail.is_read).to be false
|
437
|
+
expect(mail.trashed).to be false
|
438
|
+
expect(mail.mailbox_type).to eq "inbox"
|
439
439
|
end
|
440
440
|
|
441
441
|
#No Receiver, No Mail
|
@@ -446,14 +446,14 @@ describe "Messages And Mailboxer::Receipts" do
|
|
446
446
|
|
447
447
|
it "should have the correct recipients" do
|
448
448
|
recipients = @message2.recipients
|
449
|
-
recipients.count.
|
450
|
-
recipients.count(@entity1).
|
451
|
-
recipients.count(@entity2).
|
452
|
-
recipients.count(@entity3).
|
449
|
+
expect(recipients.count).to eq 2
|
450
|
+
expect(recipients.count(@entity1)).to eq 1
|
451
|
+
expect(recipients.count(@entity2)).to eq 1
|
452
|
+
expect(recipients.count(@entity3)).to eq 0
|
453
453
|
end
|
454
454
|
|
455
455
|
it "should be associated to the same conversation" do
|
456
|
-
@message1.conversation.id.
|
456
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
457
457
|
end
|
458
458
|
end
|
459
459
|
|
@@ -470,8 +470,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
470
470
|
end
|
471
471
|
|
472
472
|
it "should create proper message" do
|
473
|
-
@message2.sender.id.
|
474
|
-
@message2.sender.class.
|
473
|
+
expect(@message2.sender.id).to eq @entity2.id
|
474
|
+
expect(@message2.sender.class).to eq @entity2.class
|
475
475
|
assert @message2.body.eql?"Reply body"
|
476
476
|
assert @message2.subject.eql?"Subject"
|
477
477
|
end
|
@@ -481,32 +481,32 @@ describe "Messages And Mailboxer::Receipts" do
|
|
481
481
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
482
482
|
assert mail
|
483
483
|
if mail
|
484
|
-
mail.is_read.
|
485
|
-
mail.trashed.
|
486
|
-
mail.mailbox_type.
|
484
|
+
expect(mail.is_read).to be true
|
485
|
+
expect(mail.trashed).to be false
|
486
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
487
487
|
end
|
488
488
|
#Receiver Mails
|
489
489
|
@recipients2.each do |receiver|
|
490
490
|
mail = Mailboxer::Receipt.recipient(receiver).notification(@message2).first
|
491
491
|
assert mail
|
492
492
|
if mail
|
493
|
-
mail.is_read.
|
494
|
-
mail.trashed.
|
495
|
-
mail.mailbox_type.
|
493
|
+
expect(mail.is_read).to be false
|
494
|
+
expect(mail.trashed).to be false
|
495
|
+
expect(mail.mailbox_type).to eq "inbox"
|
496
496
|
end
|
497
497
|
end
|
498
498
|
end
|
499
499
|
|
500
500
|
it "should have the correct recipients" do
|
501
501
|
recipients = @message2.recipients
|
502
|
-
recipients.count.
|
503
|
-
recipients.count(@entity1).
|
504
|
-
recipients.count(@entity2).
|
505
|
-
recipients.count(@entity3).
|
502
|
+
expect(recipients.count).to eq 3
|
503
|
+
expect(recipients.count(@entity1)).to eq 1
|
504
|
+
expect(recipients.count(@entity2)).to eq 1
|
505
|
+
expect(recipients.count(@entity3)).to eq 1
|
506
506
|
end
|
507
507
|
|
508
508
|
it "should be associated to the same conversation" do
|
509
|
-
@message1.conversation.id.
|
509
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
510
510
|
end
|
511
511
|
end
|
512
512
|
describe "message replying to conversation (TODO)" do
|
@@ -550,8 +550,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
550
550
|
end
|
551
551
|
|
552
552
|
it "should create proper message" do
|
553
|
-
@message1.sender.id.
|
554
|
-
@message1.sender.class.
|
553
|
+
expect(@message1.sender.id).to eq @entity1.id
|
554
|
+
expect(@message1.sender.class).to eq @entity1.class
|
555
555
|
assert @message1.body.eql?"Body"
|
556
556
|
assert @message1.subject.eql?"Subject"
|
557
557
|
end
|
@@ -561,28 +561,28 @@ describe "Messages And Mailboxer::Receipts" do
|
|
561
561
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message1).first
|
562
562
|
assert mail
|
563
563
|
if mail
|
564
|
-
mail.is_read.
|
565
|
-
mail.trashed.
|
566
|
-
mail.mailbox_type.
|
564
|
+
expect(mail.is_read).to be true
|
565
|
+
expect(mail.trashed).to be false
|
566
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
567
567
|
end
|
568
568
|
#Receiver Mails
|
569
569
|
@recipients.each do |receiver|
|
570
570
|
mail = Mailboxer::Receipt.recipient(receiver).notification(@message1).first
|
571
571
|
assert mail
|
572
572
|
if mail
|
573
|
-
mail.is_read.
|
574
|
-
mail.trashed.
|
575
|
-
mail.mailbox_type.
|
573
|
+
expect(mail.is_read).to be false
|
574
|
+
expect(mail.trashed).to be false
|
575
|
+
expect(mail.mailbox_type).to eq "inbox"
|
576
576
|
end
|
577
577
|
end
|
578
578
|
end
|
579
579
|
|
580
580
|
it "should have the correct recipients" do
|
581
581
|
recipients = @message1.recipients
|
582
|
-
recipients.count.
|
583
|
-
recipients.count(@entity1).
|
584
|
-
recipients.count(@entity2).
|
585
|
-
recipients.count(@entity3).
|
582
|
+
expect(recipients.count).to eq 3
|
583
|
+
expect(recipients.count(@entity1)).to eq 1
|
584
|
+
expect(recipients.count(@entity2)).to eq 1
|
585
|
+
expect(recipients.count(@entity3)).to eq 1
|
586
586
|
end
|
587
587
|
|
588
588
|
end
|
@@ -596,8 +596,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
596
596
|
end
|
597
597
|
|
598
598
|
it "should create proper message" do
|
599
|
-
@message2.sender.id.
|
600
|
-
@message2.sender.class.
|
599
|
+
expect(@message2.sender.id).to eq @entity2.id
|
600
|
+
expect(@message2.sender.class).to eq @entity2.class
|
601
601
|
assert @message2.body.eql?"Reply body"
|
602
602
|
assert @message2.subject.eql?"Subject"
|
603
603
|
end
|
@@ -607,17 +607,17 @@ describe "Messages And Mailboxer::Receipts" do
|
|
607
607
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
608
608
|
assert mail
|
609
609
|
if mail
|
610
|
-
mail.is_read.
|
611
|
-
mail.trashed.
|
612
|
-
mail.mailbox_type.
|
610
|
+
expect(mail.is_read).to be true
|
611
|
+
expect(mail.trashed).to be false
|
612
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
613
613
|
end
|
614
614
|
#Receiver Mail
|
615
615
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
616
616
|
assert mail
|
617
617
|
if mail
|
618
|
-
mail.is_read.
|
619
|
-
mail.trashed.
|
620
|
-
mail.mailbox_type.
|
618
|
+
expect(mail.is_read).to be false
|
619
|
+
expect(mail.trashed).to be false
|
620
|
+
expect(mail.mailbox_type).to eq "inbox"
|
621
621
|
end
|
622
622
|
|
623
623
|
#No Receiver, No Mail
|
@@ -628,14 +628,14 @@ describe "Messages And Mailboxer::Receipts" do
|
|
628
628
|
|
629
629
|
it "should have the correct recipients" do
|
630
630
|
recipients = @message2.recipients
|
631
|
-
recipients.count.
|
632
|
-
recipients.count(@entity1).
|
633
|
-
recipients.count(@entity2).
|
634
|
-
recipients.count(@entity3).
|
631
|
+
expect(recipients.count).to eq 2
|
632
|
+
expect(recipients.count(@entity1)).to eq 1
|
633
|
+
expect(recipients.count(@entity2)).to eq 1
|
634
|
+
expect(recipients.count(@entity3)).to eq 0
|
635
635
|
end
|
636
636
|
|
637
637
|
it "should be associated to the same conversation" do
|
638
|
-
@message1.conversation.id.
|
638
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
639
639
|
end
|
640
640
|
end
|
641
641
|
|
@@ -652,8 +652,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
652
652
|
end
|
653
653
|
|
654
654
|
it "should create proper message" do
|
655
|
-
@message2.sender.id.
|
656
|
-
@message2.sender.class.
|
655
|
+
expect(@message2.sender.id).to eq @entity2.id
|
656
|
+
expect(@message2.sender.class).to eq @entity2.class
|
657
657
|
assert @message2.body.eql?"Reply body"
|
658
658
|
assert @message2.subject.eql?"Subject"
|
659
659
|
end
|
@@ -663,32 +663,32 @@ describe "Messages And Mailboxer::Receipts" do
|
|
663
663
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
664
664
|
assert mail
|
665
665
|
if mail
|
666
|
-
mail.is_read.
|
667
|
-
mail.trashed.
|
668
|
-
mail.mailbox_type.
|
666
|
+
expect(mail.is_read).to be true
|
667
|
+
expect(mail.trashed).to be false
|
668
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
669
669
|
end
|
670
670
|
#Receiver Mails
|
671
671
|
@recipients2.each do |receiver|
|
672
672
|
mail = Mailboxer::Receipt.recipient(receiver).notification(@message2).first
|
673
673
|
assert mail
|
674
674
|
if mail
|
675
|
-
mail.is_read.
|
676
|
-
mail.trashed.
|
677
|
-
mail.mailbox_type.
|
675
|
+
expect(mail.is_read).to be false
|
676
|
+
expect(mail.trashed).to be false
|
677
|
+
expect(mail.mailbox_type).to eq "inbox"
|
678
678
|
end
|
679
679
|
end
|
680
680
|
end
|
681
681
|
|
682
682
|
it "should have the correct recipients" do
|
683
683
|
recipients = @message2.recipients
|
684
|
-
recipients.count.
|
685
|
-
recipients.count(@entity1).
|
686
|
-
recipients.count(@entity2).
|
687
|
-
recipients.count(@entity3).
|
684
|
+
expect(recipients.count).to eq 3
|
685
|
+
expect(recipients.count(@entity1)).to eq 1
|
686
|
+
expect(recipients.count(@entity2)).to eq 1
|
687
|
+
expect(recipients.count(@entity3)).to eq 1
|
688
688
|
end
|
689
689
|
|
690
690
|
it "should be associated to the same conversation" do
|
691
|
-
@message1.conversation.id.
|
691
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
692
692
|
end
|
693
693
|
end
|
694
694
|
|
@@ -729,8 +729,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
729
729
|
end
|
730
730
|
|
731
731
|
it "should create proper message" do
|
732
|
-
@message1.sender.id.
|
733
|
-
@message1.sender.class.
|
732
|
+
expect(@message1.sender.id).to eq @entity1.id
|
733
|
+
expect(@message1.sender.class).to eq @entity1.class
|
734
734
|
assert @message1.body.eql?"Body"
|
735
735
|
assert @message1.subject.eql?"Subject"
|
736
736
|
end
|
@@ -740,25 +740,25 @@ describe "Messages And Mailboxer::Receipts" do
|
|
740
740
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message1).first
|
741
741
|
assert mail
|
742
742
|
if mail
|
743
|
-
mail.is_read.
|
744
|
-
mail.trashed.
|
745
|
-
mail.mailbox_type.
|
743
|
+
expect(mail.is_read).to be true
|
744
|
+
expect(mail.trashed).to be false
|
745
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
746
746
|
end
|
747
747
|
#Receiver Mail
|
748
748
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message1).first
|
749
749
|
assert mail
|
750
750
|
if mail
|
751
|
-
mail.is_read.
|
752
|
-
mail.trashed.
|
753
|
-
mail.mailbox_type.
|
751
|
+
expect(mail.is_read).to be false
|
752
|
+
expect(mail.trashed).to be false
|
753
|
+
expect(mail.mailbox_type).to eq "inbox"
|
754
754
|
end
|
755
755
|
end
|
756
756
|
|
757
757
|
it "should have the correct recipients" do
|
758
758
|
recipients = @message1.recipients
|
759
|
-
recipients.count.
|
760
|
-
recipients.count(@entity1).
|
761
|
-
recipients.count(@entity2).
|
759
|
+
expect(recipients.count).to eq 2
|
760
|
+
expect(recipients.count(@entity1)).to eq 1
|
761
|
+
expect(recipients.count(@entity2)).to eq 1
|
762
762
|
end
|
763
763
|
|
764
764
|
end
|
@@ -772,8 +772,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
772
772
|
end
|
773
773
|
|
774
774
|
it "should create proper message" do
|
775
|
-
@message2.sender.id.
|
776
|
-
@message2.sender.class.
|
775
|
+
expect(@message2.sender.id).to eq @entity2.id
|
776
|
+
expect(@message2.sender.class).to eq @entity2.class
|
777
777
|
assert @message2.body.eql?"Reply body"
|
778
778
|
assert @message2.subject.eql?"Subject"
|
779
779
|
end
|
@@ -783,29 +783,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
783
783
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
784
784
|
assert mail
|
785
785
|
if mail
|
786
|
-
mail.is_read.
|
787
|
-
mail.trashed.
|
788
|
-
mail.mailbox_type.
|
786
|
+
expect(mail.is_read).to be true
|
787
|
+
expect(mail.trashed).to be false
|
788
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
789
789
|
end
|
790
790
|
#Receiver Mail
|
791
791
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
792
792
|
assert mail
|
793
793
|
if mail
|
794
|
-
mail.is_read.
|
795
|
-
mail.trashed.
|
796
|
-
mail.mailbox_type.
|
794
|
+
expect(mail.is_read).to be false
|
795
|
+
expect(mail.trashed).to be false
|
796
|
+
expect(mail.mailbox_type).to eq "inbox"
|
797
797
|
end
|
798
798
|
end
|
799
799
|
|
800
800
|
it "should have the correct recipients" do
|
801
801
|
recipients = @message2.recipients
|
802
|
-
recipients.count.
|
803
|
-
recipients.count(@entity1).
|
804
|
-
recipients.count(@entity2).
|
802
|
+
expect(recipients.count).to eq 2
|
803
|
+
expect(recipients.count(@entity1)).to eq 1
|
804
|
+
expect(recipients.count(@entity2)).to eq 1
|
805
805
|
end
|
806
806
|
|
807
807
|
it "should be associated to the same conversation" do
|
808
|
-
@message1.conversation.id.
|
808
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
809
809
|
end
|
810
810
|
end
|
811
811
|
|
@@ -818,8 +818,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
818
818
|
end
|
819
819
|
|
820
820
|
it "should create proper message" do
|
821
|
-
@message2.sender.id.
|
822
|
-
@message2.sender.class.
|
821
|
+
expect(@message2.sender.id).to eq @entity2.id
|
822
|
+
expect(@message2.sender.class).to eq @entity2.class
|
823
823
|
assert @message2.body.eql?"Reply body"
|
824
824
|
assert @message2.subject.eql?"Subject"
|
825
825
|
end
|
@@ -829,29 +829,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
829
829
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
830
830
|
assert mail
|
831
831
|
if mail
|
832
|
-
mail.is_read.
|
833
|
-
mail.trashed.
|
834
|
-
mail.mailbox_type.
|
832
|
+
expect(mail.is_read).to be true
|
833
|
+
expect(mail.trashed).to be false
|
834
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
835
835
|
end
|
836
836
|
#Receiver Mail
|
837
837
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
838
838
|
assert mail
|
839
839
|
if mail
|
840
|
-
mail.is_read.
|
841
|
-
mail.trashed.
|
842
|
-
mail.mailbox_type.
|
840
|
+
expect(mail.is_read).to be false
|
841
|
+
expect(mail.trashed).to be false
|
842
|
+
expect(mail.mailbox_type).to eq "inbox"
|
843
843
|
end
|
844
844
|
end
|
845
845
|
|
846
846
|
it "should have the correct recipients" do
|
847
847
|
recipients = @message2.recipients
|
848
|
-
recipients.count.
|
849
|
-
recipients.count(@entity1).
|
850
|
-
recipients.count(@entity2).
|
848
|
+
expect(recipients.count).to eq 2
|
849
|
+
expect(recipients.count(@entity1)).to eq 1
|
850
|
+
expect(recipients.count(@entity2)).to eq 1
|
851
851
|
end
|
852
852
|
|
853
853
|
it "should be associated to the same conversation" do
|
854
|
-
@message1.conversation.id.
|
854
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
855
855
|
end
|
856
856
|
end
|
857
857
|
describe "message replying to conversation" do
|
@@ -863,8 +863,8 @@ describe "Messages And Mailboxer::Receipts" do
|
|
863
863
|
end
|
864
864
|
|
865
865
|
it "should create proper message" do
|
866
|
-
@message2.sender.id.
|
867
|
-
@message2.sender.class.
|
866
|
+
expect(@message2.sender.id).to eq @entity2.id
|
867
|
+
expect(@message2.sender.class).to eq @entity2.class
|
868
868
|
assert @message2.body.eql?"Reply body"
|
869
869
|
assert @message2.subject.eql?"Subject"
|
870
870
|
end
|
@@ -874,29 +874,29 @@ describe "Messages And Mailboxer::Receipts" do
|
|
874
874
|
mail = Mailboxer::Receipt.recipient(@entity2).notification(@message2).first
|
875
875
|
assert mail
|
876
876
|
if mail
|
877
|
-
mail.is_read.
|
878
|
-
mail.trashed.
|
879
|
-
mail.mailbox_type.
|
877
|
+
expect(mail.is_read).to be true
|
878
|
+
expect(mail.trashed).to be false
|
879
|
+
expect(mail.mailbox_type).to eq "sentbox"
|
880
880
|
end
|
881
881
|
#Receiver Mail
|
882
882
|
mail = Mailboxer::Receipt.recipient(@entity1).notification(@message2).first
|
883
883
|
assert mail
|
884
884
|
if mail
|
885
|
-
mail.is_read.
|
886
|
-
mail.trashed.
|
887
|
-
mail.mailbox_type.
|
885
|
+
expect(mail.is_read).to be false
|
886
|
+
expect(mail.trashed).to be false
|
887
|
+
expect(mail.mailbox_type).to eq "inbox"
|
888
888
|
end
|
889
889
|
end
|
890
890
|
|
891
891
|
it "should have the correct recipients" do
|
892
892
|
recipients = @message2.recipients
|
893
|
-
recipients.count.
|
894
|
-
recipients.count(@entity1).
|
895
|
-
recipients.count(@entity2).
|
893
|
+
expect(recipients.count).to eq 2
|
894
|
+
expect(recipients.count(@entity1)).to eq 1
|
895
|
+
expect(recipients.count(@entity2)).to eq 1
|
896
896
|
end
|
897
897
|
|
898
898
|
it "should be associated to the same conversation" do
|
899
|
-
@message1.conversation.id.
|
899
|
+
expect(@message1.conversation.id).to eq @message2.conversation.id
|
900
900
|
end
|
901
901
|
end
|
902
902
|
end
|