keymail 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -25
- data/app/mailers/keymail/auth_mailer.rb +2 -2
- data/app/models/keymail/authentication.rb +2 -1
- data/lib/keymail/version.rb +1 -1
- data/test/dummy/app/controllers/auth_controller.rb +8 -5
- data/test/dummy/app/views/auth/fail.html.erb +1 -0
- data/test/dummy/app/views/auth/request_email.html.erb +2 -4
- data/test/dummy/app/views/layouts/application.html.erb +0 -2
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/dummy/config/initializers/setup_mail.rb +1 -3
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +672 -0
- data/test/dummy/log/test.log +6341 -0
- data/test/integration/feature_test.rb +6 -0
- data/test/models/keymail/authentication_test.rb +8 -2
- data/test/test_helper.rb +0 -5
- metadata +4 -4
- data/test/dummy/tmp/pids/server.pid +0 -1
@@ -18,6 +18,12 @@ describe 'Feature Integration' do
|
|
18
18
|
page.must_have_content 'success'
|
19
19
|
end
|
20
20
|
|
21
|
+
it 'only works once' do
|
22
|
+
current_email.first(:link).click
|
23
|
+
current_email.first(:link).click
|
24
|
+
page.must_have_content 'failed'
|
25
|
+
end
|
26
|
+
|
21
27
|
# it 'logs in a user with an optional passcode'
|
22
28
|
|
23
29
|
end
|
@@ -4,12 +4,18 @@ module Keymail
|
|
4
4
|
describe Authentication do
|
5
5
|
context '.request' do
|
6
6
|
|
7
|
+
let(:email) { 'test@email.com' }
|
8
|
+
|
7
9
|
it 'creates a new token' do
|
8
|
-
-> { Authentication.request(
|
10
|
+
-> { Authentication.request(email) }.must_change 'Token.count', +1
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns the token on success' do
|
14
|
+
Authentication.request(email).must_be_kind_of Token
|
9
15
|
end
|
10
16
|
|
11
17
|
it 'sends an email' do
|
12
|
-
-> { Authentication.request(
|
18
|
+
-> { Authentication.request(email) }.must_change 'ActionMailer::Base.deliveries.count', +1
|
13
19
|
end
|
14
20
|
|
15
21
|
it 'raises an error if email is nil' do
|
data/test/test_helper.rb
CHANGED
@@ -70,10 +70,5 @@ class AcceptanceSpec < MiniTest::Spec
|
|
70
70
|
include Rails.application.routes.url_helpers
|
71
71
|
include Capybara::DSL
|
72
72
|
include Capybara::Email::DSL
|
73
|
-
|
74
|
-
# before do
|
75
|
-
# @routes = Rails.application.routes
|
76
|
-
# end
|
77
|
-
|
78
73
|
end
|
79
74
|
MiniTest::Spec.register_spec_type(/Integration$/, AcceptanceSpec)
|
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.2.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-
|
11
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- test/dummy/Rakefile
|
51
51
|
- test/dummy/app/controllers/application_controller.rb
|
52
52
|
- test/dummy/app/controllers/auth_controller.rb
|
53
|
+
- test/dummy/app/views/auth/fail.html.erb
|
53
54
|
- test/dummy/app/views/auth/new.html.erb
|
54
55
|
- test/dummy/app/views/auth/request_email.html.erb
|
55
56
|
- test/dummy/app/views/auth/success.html.erb
|
@@ -91,7 +92,6 @@ files:
|
|
91
92
|
- test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
92
93
|
- test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
93
94
|
- test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
94
|
-
- test/dummy/tmp/pids/server.pid
|
95
95
|
- test/factories.rb
|
96
96
|
- test/integration/feature_test.rb
|
97
97
|
- test/keymail_test.rb
|
@@ -127,6 +127,7 @@ test_files:
|
|
127
127
|
- test/dummy/Rakefile
|
128
128
|
- test/dummy/app/controllers/application_controller.rb
|
129
129
|
- test/dummy/app/controllers/auth_controller.rb
|
130
|
+
- test/dummy/app/views/auth/fail.html.erb
|
130
131
|
- test/dummy/app/views/auth/new.html.erb
|
131
132
|
- test/dummy/app/views/auth/request_email.html.erb
|
132
133
|
- test/dummy/app/views/auth/success.html.erb
|
@@ -168,7 +169,6 @@ test_files:
|
|
168
169
|
- test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
|
169
170
|
- test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
170
171
|
- test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
171
|
-
- test/dummy/tmp/pids/server.pid
|
172
172
|
- test/factories.rb
|
173
173
|
- test/integration/feature_test.rb
|
174
174
|
- test/keymail_test.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
95672
|