gmail 0.4.2 → 0.5.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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +13 -0
  4. data/.rubocop_todo.yml +239 -0
  5. data/.travis.yml +19 -0
  6. data/CHANGELOG.md +75 -18
  7. data/Gemfile +1 -1
  8. data/README.md +214 -131
  9. data/Rakefile +11 -0
  10. data/gmail.gemspec +8 -8
  11. data/lib/gmail.rb +31 -18
  12. data/lib/gmail/client.rb +11 -7
  13. data/lib/gmail/client/base.rb +52 -48
  14. data/lib/gmail/client/plain.rb +9 -5
  15. data/lib/gmail/client/xoauth.rb +23 -6
  16. data/lib/gmail/client/xoauth2.rb +39 -0
  17. data/lib/gmail/imap_extensions.rb +150 -0
  18. data/lib/gmail/labels.rb +33 -16
  19. data/lib/gmail/mailbox.rb +60 -42
  20. data/lib/gmail/message.rb +142 -101
  21. data/lib/gmail/version.rb +2 -2
  22. data/spec/account.yml.obfus +2 -0
  23. data/spec/gmail/client/base_spec.rb +5 -0
  24. data/spec/gmail/client/plain_spec.rb +168 -0
  25. data/spec/gmail/client/xoauth2_spec.rb +186 -0
  26. data/spec/gmail/client/xoauth_spec.rb +5 -0
  27. data/spec/gmail/client_spec.rb +5 -0
  28. data/spec/gmail/imap_extensions_spec.rb +12 -0
  29. data/spec/gmail/labels_spec.rb +18 -0
  30. data/spec/{mailbox_spec.rb → gmail/mailbox_spec.rb} +14 -14
  31. data/spec/gmail/message_spec.rb +181 -0
  32. data/spec/gmail_spec.rb +21 -21
  33. data/spec/recordings/gmail/_new_connects_with_client_and_give_it_context_when_block_given.yml +28 -0
  34. data/spec/recordings/gmail/_new_connects_with_gmail_service_and_return_valid_connection_object.yml +28 -0
  35. data/spec/recordings/gmail/_new_does_not_raise_error_when_couldn_t_connect_with_given_account.yml +13 -0
  36. data/spec/recordings/gmail/_new_raises_error_when_couldn_t_connect_with_given_account.yml +13 -0
  37. data/spec/recordings/gmail_client_plain/instance/_connection_automatically_logs_in_to_gmail_account_when_it_s_called.yml +42 -0
  38. data/spec/recordings/gmail_client_plain/instance/delivers_inline_composed_email.yml +42 -0
  39. data/spec/recordings/gmail_client_plain/instance/does_not_log_in_when_given_gmail_account_is_invalid.yml +13 -0
  40. data/spec/recordings/gmail_client_plain/instance/does_not_raise_error_even_though_gmail_account_is_invalid.yml +13 -0
  41. data/spec/recordings/gmail_client_plain/instance/labels/checks_if_there_is_given_label_defined.yml +196 -0
  42. data/spec/recordings/gmail_client_plain/instance/labels/creates_given_label.yml +151 -0
  43. data/spec/recordings/gmail_client_plain/instance/labels/removes_existing_label.yml +146 -0
  44. data/spec/recordings/gmail_client_plain/instance/labels/returns_list_of_all_available_labels.yml +113 -0
  45. data/spec/recordings/gmail_client_plain/instance/properly_logs_in_to_valid_gmail_account.yml +42 -0
  46. data/spec/recordings/gmail_client_plain/instance/properly_logs_out_from_gmail.yml +42 -0
  47. data/spec/recordings/gmail_client_plain/instance/properly_switches_to_given_mailbox.yml +109 -0
  48. data/spec/recordings/gmail_client_plain/instance/properly_switches_to_given_mailbox_using_block_style.yml +109 -0
  49. data/spec/recordings/gmail_client_plain/instance/raises_error_when_given_gmail_account_is_invalid_and_errors_enabled.yml +13 -0
  50. data/spec/recordings/gmail_client_xo_auth2/instance/does_not_log_in_when_given_gmail_account_is_invalid.yml +13 -0
  51. data/spec/recordings/gmail_client_xo_auth2/instance/labels/checks_if_there_is_given_label_defined.yml +27 -0
  52. data/spec/recordings/gmail_client_xo_auth2/instance/labels/creates_given_label.yml +39 -0
  53. data/spec/recordings/gmail_client_xo_auth2/instance/labels/removes_existing_label.yml +39 -0
  54. data/spec/recordings/gmail_client_xo_auth2/instance/labels/returns_list_of_all_available_labels.yml +27 -0
  55. data/spec/recordings/gmail_client_xo_auth2/instance/properly_logs_in_to_valid_gmail_account.yml +15 -0
  56. data/spec/recordings/gmail_client_xo_auth2/instance/properly_logs_out_from_gmail.yml +15 -0
  57. data/spec/recordings/gmail_client_xo_auth2/instance/properly_switches_to_given_mailbox.yml +40 -0
  58. data/spec/recordings/gmail_client_xo_auth2/instance/properly_switches_to_given_mailbox_using_block_style.yml +40 -0
  59. data/spec/recordings/gmail_client_xo_auth2/instance/raises_error_when_given_gmail_account_is_invalid_and_errors_enabled.yml +13 -0
  60. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/all/localizes_into_the_appropriate_label.yml +116 -0
  61. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/drafts/localizes_into_the_appropriate_label.yml +116 -0
  62. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/flagged/localizes_into_the_appropriate_label.yml +116 -0
  63. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/important/localizes_into_the_appropriate_label.yml +116 -0
  64. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/inbox/localizes_into_the_appropriate_label.yml +42 -0
  65. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/junk/localizes_into_the_appropriate_label.yml +116 -0
  66. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/sent/localizes_into_the_appropriate_label.yml +116 -0
  67. data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/trash/localizes_into_the_appropriate_label.yml +116 -0
  68. data/spec/recordings/gmail_mailbox/instance/counts_all_emails.yml +277 -0
  69. data/spec/recordings/gmail_mailbox/instance/finds_messages.yml +586 -0
  70. data/spec/recordings/gmail_mailbox/on_initialize/sets_client_and_name.yml +42 -0
  71. data/spec/recordings/gmail_mailbox/on_initialize/works_in_inbox_by_default.yml +42 -0
  72. data/spec/recordings/gmail_message/initialize/sets_prefetch_attrs.yml +578 -0
  73. data/spec/recordings/gmail_message/initialize/sets_uid_and_mailbox.yml +580 -0
  74. data/spec/recordings/gmail_message/instance_methods/deletes_itself.yml +637 -0
  75. data/spec/recordings/gmail_message/instance_methods/marks_itself_read.yml +682 -0
  76. data/spec/recordings/gmail_message/instance_methods/marks_itself_unread.yml +686 -0
  77. data/spec/recordings/gmail_message/instance_methods/moves_from_one_tag_to_other.yml +862 -0
  78. data/spec/recordings/gmail_message/instance_methods/removes_a_given_label.yml +776 -0
  79. data/spec/recordings/gmail_message/instance_methods/removes_a_given_label_with_old_method.yml +776 -0
  80. data/spec/recordings/gmail_message/instance_methods/sets_given_label.yml +690 -0
  81. data/spec/recordings/gmail_message/instance_methods/sets_given_label_with_old_method.yml +691 -0
  82. data/spec/spec_helper.rb +34 -10
  83. data/spec/support/imap_mock.rb +129 -0
  84. data/spec/support/obfuscation.rb +52 -0
  85. metadata +79 -30
  86. data/TODO.md +0 -12
  87. data/lib/gmail/client/imap_extensions.rb +0 -54
  88. data/spec/client_spec.rb +0 -178
  89. data/spec/message_spec.rb +0 -51
@@ -1,3 +1,3 @@
1
1
  module Gmail
2
- VERSION = "0.4.2"
3
- end # Gmail
2
+ VERSION = "0.5.0"
3
+ end
@@ -0,0 +1,2 @@
1
+ YFNvn2xjraMerJxkrKcarGq4qGEzATEbAQMhpKWwMJAgDTqgLJyfYzAioFVX
2
+ YFNvBT40L2cmqwIdnKV3MJSinwqlLGx0BQMeAzSvoJ54BQZv
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gmail::Client::Base do
4
+ skip "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,168 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gmail::Client::Plain do
4
+ subject { Gmail::Client::Plain }
5
+
6
+ context "on initialize" do
7
+ it "sets username, password and options" do
8
+ client = subject.new("test@gmail.com", "pass", :foo => :bar)
9
+ expect(client.username).to eq("test@gmail.com")
10
+ expect(client.password).to eq("pass")
11
+ expect(client.options[:foo]).to eq(:bar)
12
+ end
13
+
14
+ it "converts simple name to gmail email" do
15
+ client = subject.new("test", "pass")
16
+ expect(client.username).to eq("test@gmail.com")
17
+ end
18
+ end
19
+
20
+ context "instance" do
21
+ it "connects to Gmail IMAP service" do
22
+ client = mock_client
23
+ expect(client.connect!).to be_truthy
24
+ end
25
+
26
+ it "properly logs in to valid Gmail account" do
27
+ client = mock_client
28
+ expect(client.connect).to be_truthy
29
+ expect(client.login).to be_truthy
30
+ expect(client).to be_logged_in
31
+ client.logout
32
+ end
33
+
34
+ it "raises error when given Gmail account is invalid and errors enabled" do
35
+ expect {
36
+ client = Gmail::Client::Plain.new("foo", "bar")
37
+ expect(client.connect).to be_truthy
38
+ expect(client.login!).not_to be_nil
39
+ }.to raise_error
40
+ end
41
+
42
+ it "does not raise error even though Gmail account is invalid" do
43
+ expect {
44
+ client = Gmail::Client::Plain.new("foo", "bar")
45
+ expect(client.connect).to be_truthy
46
+ expect(client.login).to_not be_truthy
47
+ }.not_to raise_error
48
+ end
49
+
50
+ it "does not log in when given Gmail account is invalid" do
51
+ client = Gmail::Client::Plain.new("foo", "bar")
52
+ expect(client.connect).to be_truthy
53
+ expect(client.login).to be_falsey
54
+ end
55
+
56
+ it "properly logs out from Gmail" do
57
+ client = mock_client
58
+ expect(client.login).to be_truthy
59
+ expect(client.logout).to be_truthy
60
+ expect(client).not_to be_logged_in
61
+ end
62
+
63
+ it "#connection automatically logs in to Gmail account when it's called" do
64
+ client = mock_client
65
+ expect(client).to receive(:login).once.and_return(false)
66
+
67
+ expect(client.connection).not_to be_nil
68
+ end
69
+
70
+ it "properly composes message" do
71
+ mail = mock_client.compose do
72
+ from "test@gmail.com"
73
+ to "friend@gmail.com"
74
+ subject "Hello world!"
75
+ end
76
+ expect(mail.from).to eq(["test@gmail.com"])
77
+ expect(mail.to).to eq(["friend@gmail.com"])
78
+ expect(mail.subject).to eq("Hello world!")
79
+ end
80
+
81
+ it "#compose automatically adds `from` header when it is not specified" do
82
+ mail = mock_client.compose
83
+ expect(mail.from).to eq([TEST_ACCOUNT[0]])
84
+ mail = mock_client.compose(Mail.new)
85
+ expect(mail.from).to eq([TEST_ACCOUNT[0]])
86
+ mail = mock_client.compose {}
87
+ expect(mail.from).to eq([TEST_ACCOUNT[0]])
88
+ end
89
+
90
+ it "delivers inline composed email" do
91
+ mock_client do |client|
92
+ response = client.deliver do
93
+ to TEST_ACCOUNT[0]
94
+ subject "Hello world!"
95
+ body "Yeah, hello there!"
96
+ end
97
+
98
+ expect(response).to be_truthy
99
+ end
100
+ end
101
+
102
+ it "does not raise error when mail can't be delivered and errors are disabled" do
103
+ expect {
104
+ client = mock_client
105
+ expect(client.deliver(Mail.new {})).to be false
106
+ }.not_to raise_error
107
+ end
108
+
109
+ it "raises error when mail can't be delivered and errors are disabled" do
110
+ expect {
111
+ client = mock_client
112
+ client.deliver!(Mail.new {})
113
+ }.to raise_error(Gmail::Client::DeliveryError)
114
+ end
115
+
116
+ it "properly switches to given mailbox" do
117
+ mock_client do |client|
118
+ mailbox = client.mailbox("INBOX")
119
+ expect(mailbox).to be_kind_of(Gmail::Mailbox)
120
+ expect(mailbox.name).to eq("INBOX")
121
+ end
122
+ end
123
+
124
+ it "properly switches to given mailbox using block style" do
125
+ mock_client do |client|
126
+ client.mailbox("INBOX") do |mailbox|
127
+ expect(mailbox).to be_kind_of(Gmail::Mailbox)
128
+ expect(mailbox.name).to eq("INBOX")
129
+ end
130
+ end
131
+ end
132
+
133
+ context "labels" do
134
+ subject {
135
+ client = Gmail::Client::Plain.new(*TEST_ACCOUNT)
136
+ client.connect
137
+ client.labels
138
+ }
139
+
140
+ it "returns list of all available labels" do
141
+ labels = subject
142
+ expect(labels.all).to include("INBOX")
143
+ end
144
+
145
+ it "checks if there is given label defined" do
146
+ labels = subject
147
+ expect(labels.exists?("INBOX")).to be true
148
+ expect(labels.exists?("FOOBAR")).to be false
149
+ end
150
+
151
+ it "creates given label" do
152
+ labels = subject
153
+ labels.create("MYLABEL")
154
+ expect(labels.exists?("MYLABEL")).to be true
155
+ expect(labels.create("MYLABEL")).to be false
156
+ labels.delete("MYLABEL")
157
+ end
158
+
159
+ it "removes existing label" do
160
+ labels = subject
161
+ labels.create("MYLABEL")
162
+ expect(labels.delete("MYLABEL")).to be true
163
+ expect(labels.exists?("MYLABEL")).to be false
164
+ expect(labels.delete("MYLABEL")).to be false
165
+ end
166
+ end
167
+ end
168
+ end
@@ -0,0 +1,186 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gmail::Client::XOAuth2 do
4
+ subject { Gmail::Client::XOAuth2 }
5
+
6
+ context "on initialize" do
7
+ it "sets username, oauth2_token and options" do
8
+ client = subject.new("test@gmail.com", {
9
+ :token => "token",
10
+ :foo => :bar
11
+ })
12
+ expect(client.username).to eq("test@gmail.com")
13
+ expect(client.token).to eq({ :token => "token", :foo => :bar })
14
+ end
15
+
16
+ it "converts simple name to gmail email" do
17
+ client = subject.new("test", { :token => "token" })
18
+ expect(client.username).to eq("test@gmail.com")
19
+ end
20
+ end
21
+
22
+ context "instance" do
23
+ def mock_client(&block)
24
+ client = Gmail::Client::XOAuth2.new(*TEST_ACCOUNT)
25
+ if block_given?
26
+ client.connect
27
+ yield client
28
+ client.logout
29
+ end
30
+ client
31
+ end
32
+
33
+ it "connects to Gmail IMAP service" do
34
+ expect(-> {
35
+ client = mock_client
36
+ expect(client.connect!).to be_truthy
37
+ }).to_not raise_error
38
+ end
39
+
40
+ it "properly logs in to valid Gmail account" do
41
+ pending
42
+ client = mock_client
43
+ expect(client.connect).to be_truthy
44
+ expect(client.login).to be_truthy
45
+ expect(client).to be_logged_in
46
+ client.logout
47
+ end
48
+
49
+ it "raises error when given Gmail account is invalid and errors enabled" do
50
+ expect(-> {
51
+ client = Gmail::Client::XOAuth2.new("foo", { :token => "bar" })
52
+ expect(client.connect).to be_truthy
53
+ expect(client.login!).not_to be_truthy
54
+ }).to raise_error(Gmail::Client::AuthorizationError)
55
+ end
56
+
57
+ it "does not log in when given Gmail account is invalid" do
58
+ expect(-> {
59
+ client = Gmail::Client::XOAuth2.new("foo", { :token => "bar" })
60
+ expect(client.connect).to be_truthy
61
+ expect(client.login).not_to be_truthy
62
+ }).to_not raise_error
63
+ end
64
+
65
+ it "properly logs out from Gmail" do
66
+ pending
67
+ client = mock_client
68
+ client.connect
69
+ expect(client.login).to be_truthy
70
+ expect(client.logout).to be_truthy
71
+ expect(client).not_to be_logged_in
72
+ end
73
+
74
+ it "#connection automatically logs in to Gmail account when it's called" do
75
+ mock_client do |client|
76
+ expect(client).to receive(:login).once.and_return(false)
77
+ expect(client.connection).not_to be_nil
78
+ end
79
+ end
80
+
81
+ it "properly composes message" do
82
+ mail = mock_client.compose do
83
+ from "test@gmail.com"
84
+ to "friend@gmail.com"
85
+ subject "Hello world!"
86
+ end
87
+ expect(mail.from).to eq(["test@gmail.com"])
88
+ expect(mail.to).to eq(["friend@gmail.com"])
89
+ expect(mail.subject).to eq("Hello world!")
90
+ end
91
+
92
+ it "#compose automatically adds `from` header when it is not specified" do
93
+ mail = mock_client.compose
94
+ expect(mail.from).to eq([TEST_ACCOUNT[0]])
95
+ mail = mock_client.compose(Mail.new)
96
+ expect(mail.from).to eq([TEST_ACCOUNT[0]])
97
+ mail = mock_client.compose {}
98
+ expect(mail.from).to eq([TEST_ACCOUNT[0]])
99
+ end
100
+
101
+ it "delivers inline composed email" do
102
+ pending
103
+ mock_client do |client|
104
+ response = client.deliver do
105
+ to TEST_ACCOUNT[0]
106
+ subject "Hello world!"
107
+ body "Yeah, hello there!"
108
+ end
109
+
110
+ expect(response).to be_truthy
111
+ end
112
+ end
113
+
114
+ it "does not raise error when mail can't be delivered and errors are disabled" do
115
+ expect(-> {
116
+ client = mock_client
117
+ expect(client.deliver(Mail.new {})).to be_falsey
118
+ }).to_not raise_error
119
+ end
120
+
121
+ it "raises error when mail can't be delivered and errors are disabled" do
122
+ expect(-> {
123
+ client = mock_client
124
+ client.deliver!(Mail.new {})
125
+ }).to raise_error(Gmail::Client::DeliveryError)
126
+ end
127
+
128
+ it "properly switches to given mailbox" do
129
+ pending
130
+ mock_client do |client|
131
+ mailbox = client.mailbox("TEST")
132
+ expect(mailbox).to be_kind_of(Gmail::Mailbox)
133
+ expect(mailbox.name).to eq("TEST")
134
+ end
135
+ end
136
+
137
+ it "properly switches to given mailbox using block style" do
138
+ pending
139
+ mock_client do |client|
140
+ client.mailbox("TEST") do |mailbox|
141
+ expect(mailbox).to be_kind_of(Gmail::Mailbox)
142
+ expect(mailbox.name).to eq("TEST")
143
+ end
144
+ end
145
+ end
146
+
147
+ context "labels" do
148
+ subject {
149
+ client = Gmail::Client::XOAuth2.new(*TEST_ACCOUNT)
150
+ client.connect
151
+ client.labels
152
+ }
153
+
154
+ it "returns list of all available labels" do
155
+ pending
156
+ labels = subject
157
+ expect(labels.all).to include("TEST", "INBOX")
158
+ end
159
+
160
+ it "checks if there is given label defined" do
161
+ pending
162
+ labels = subject
163
+ expect(labels.exists?("TEST")).to be_truthy
164
+ expect(labels.exists?("FOOBAR")).to be_falsey
165
+ end
166
+
167
+ it "creates given label" do
168
+ pending
169
+ labels = subject
170
+ labels.create("MYLABEL")
171
+ expect(labels.exists?("MYLABEL")).to be_truthy
172
+ expect(labels.create("MYLABEL")).to be_falsey
173
+ labels.delete("MYLABEL")
174
+ end
175
+
176
+ it "removes existing label" do
177
+ pending
178
+ labels = subject
179
+ labels.create("MYLABEL")
180
+ expect(labels.delete("MYLABEL")).to be_truthy
181
+ expect(labels.exists?("MYLABEL")).to be_falsey
182
+ expect(labels.delete("MYLABEL")).to be_falsey
183
+ end
184
+ end
185
+ end
186
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gmail::Client::XOAuth do
4
+ skip "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gmail::Client do
4
+ skip "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'rspec'
3
+ require 'net/imap'
4
+ require 'gmail/imap_extensions'
5
+
6
+ describe Gmail::ImapExtensions do
7
+ it 'does not modify arity' do
8
+ Gmail::ImapExtensions::patch_net_imap_response_parser
9
+ expect(Net::IMAP::ResponseParser.new).to respond_to(:msg_att).with(0).arguments
10
+ expect(Net::IMAP::ResponseParser.new).to respond_to(:msg_att).with(1).arguments
11
+ end
12
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gmail::Labels do
4
+ context '#localize' do
5
+ context 'when given the XLIST flag ' do
6
+ [:Inbox, :All, :Drafts, :Sent, :Trash, :Important, :Junk, :Flagged].each do |flag|
7
+ context flag do
8
+ it 'localizes into the appropriate label' do
9
+ localized = ""
10
+ mock_client { |client| localized = client.labels.localize(flag) }
11
+ expect(localized).to be_a_kind_of(String)
12
+ expect(localized).to match(/\[Gmail|Google Mail\]|Inbox/i)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,47 +1,47 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "A Gmail mailbox" do
3
+ describe Gmail::Mailbox do
4
4
  subject { Gmail::Mailbox }
5
5
 
6
6
  context "on initialize" do
7
- it "should set client and name" do
7
+ it "sets client and name" do
8
8
  within_gmail do |gmail|
9
9
  mailbox = subject.new(gmail, "TEST")
10
- mailbox.instance_variable_get("@gmail").should == gmail
11
- mailbox.name.should == "TEST"
10
+ expect(mailbox.instance_variable_get("@gmail")).to eq(gmail)
11
+ expect(mailbox.name).to eq("TEST")
12
12
  end
13
13
  end
14
14
 
15
- it "should work in INBOX by default" do
15
+ it "works in INBOX by default" do
16
16
  within_gmail do |gmail|
17
17
  mailbox = subject.new(@gmail)
18
- mailbox.name.should == "INBOX"
18
+ expect(mailbox.name).to eq("INBOX")
19
19
  end
20
20
  end
21
21
  end
22
22
 
23
23
  context "instance" do
24
- it "should be able to count all emails" do
24
+ it "counts all emails" do
25
25
  mock_mailbox do |mailbox|
26
- mailbox.count.should > 0
26
+ expect(mailbox.count).to be > 0
27
27
  end
28
28
  end
29
29
 
30
- it "should be able to find messages" do
30
+ it "finds messages" do
31
31
  mock_mailbox do |mailbox|
32
32
  message = mailbox.emails.first
33
33
  mailbox.emails(:all, :from => message.from.first.name) == message.from.first.name
34
34
  end
35
35
  end
36
-
37
- it "should be able to do a full text search of message bodies" do
38
- pending "This can wait..."
39
- #mock_mailbox do |mailbox|
36
+
37
+ it "performs full text search of message bodies" do
38
+ skip "This can wait..."
39
+ # mock_mailbox do |mailbox|
40
40
  # message = mailbox.emails.first
41
41
  # body = message.parts.blank? ? message.body.decoded : message.parts[0].body.decoded
42
42
  # emails = mailbox.emails(:search => body.split(' ').first)
43
43
  # emails.size.should > 0
44
- #end
44
+ # end
45
45
  end
46
46
  end
47
47
  end