keymail 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +13 -19
- data/Rakefile +17 -8
- data/app/models/keymail/authentication.rb +1 -2
- data/lib/keymail/engine.rb +12 -4
- data/lib/keymail/version.rb +1 -1
- data/test/dummy/log/test.log +18281 -0
- data/test/mailers/keymail/auth_mailer_test.rb +4 -6
- data/test/models/keymail/authentication_test.rb +5 -0
- metadata +2 -3
- data/app/controllers/keymail/application_controller.rb +0 -4
|
@@ -4,18 +4,17 @@ module Keymail
|
|
|
4
4
|
describe AuthMailer do
|
|
5
5
|
|
|
6
6
|
let(:token) { Factory :token }
|
|
7
|
-
let(:
|
|
7
|
+
let(:emails) { ActionMailer::Base.deliveries }
|
|
8
|
+
let(:email) { emails.last }
|
|
8
9
|
let(:body) { email.body.raw_source }
|
|
9
10
|
|
|
10
11
|
before do
|
|
11
|
-
|
|
12
|
-
ActionMailer::Base.deliveries.clear
|
|
12
|
+
emails.clear
|
|
13
13
|
AuthMailer.log_in(token).deliver
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
it 'sends the email' do
|
|
18
|
-
|
|
17
|
+
emails.wont_be :empty?
|
|
19
18
|
end
|
|
20
19
|
|
|
21
20
|
it 'sends authentication email to the right address' do
|
|
@@ -23,7 +22,6 @@ module Keymail
|
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
it 'has the log in link' do
|
|
26
|
-
# TODO: link_to
|
|
27
25
|
body.must_have_content "http://localhost:3000/auth/#{token.url_key}"
|
|
28
26
|
end
|
|
29
27
|
|
|
@@ -21,6 +21,11 @@ module Keymail
|
|
|
21
21
|
it 'raises an error if email is nil' do
|
|
22
22
|
-> { Authentication.request(nil) }.must_raise ArgumentError
|
|
23
23
|
end
|
|
24
|
+
|
|
25
|
+
it 'sets the expiration time to the configured one' do
|
|
26
|
+
Keymail.config.expiration_time = 1.minute
|
|
27
|
+
Authentication.request(email).expires_at.must_be_close_to 1.minute.since, 0.1
|
|
28
|
+
end
|
|
24
29
|
end
|
|
25
30
|
|
|
26
31
|
context '.verify_url' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: keymail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- alcesleo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-05-
|
|
11
|
+
date: 2014-05-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -35,7 +35,6 @@ files:
|
|
|
35
35
|
- LICENSE
|
|
36
36
|
- README.md
|
|
37
37
|
- Rakefile
|
|
38
|
-
- app/controllers/keymail/application_controller.rb
|
|
39
38
|
- app/mailers/keymail/auth_mailer.rb
|
|
40
39
|
- app/models/keymail/authentication.rb
|
|
41
40
|
- app/models/keymail/token.rb
|