nyauth 0.2.8 → 0.3.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 +8 -4
- data/app/controllers/concerns/nyauth/client_concern.rb +21 -9
- data/app/controllers/concerns/nyauth/{application_concern.rb → controller_concern.rb} +3 -1
- data/app/controllers/concerns/nyauth/session_concern.rb +2 -1
- data/app/controllers/nyauth/confirmation_requests_controller.rb +3 -4
- data/app/controllers/nyauth/confirmations_controller.rb +3 -4
- data/app/controllers/nyauth/passwords_controller.rb +5 -7
- data/app/controllers/nyauth/registrations_controller.rb +4 -5
- data/app/controllers/nyauth/reset_password_requests_controller.rb +3 -4
- data/app/controllers/nyauth/reset_passwords_controller.rb +5 -6
- data/app/controllers/nyauth/sessions_controller.rb +9 -7
- data/app/helpers/nyauth/application_helper.rb +6 -6
- data/app/views/nyauth/confirmation_requests/new.html.erb +1 -1
- data/app/views/nyauth/passwords/edit.html.erb +1 -1
- data/app/views/nyauth/registrations/new.html.erb +1 -1
- data/app/views/nyauth/reset_password_requests/new.html.erb +1 -1
- data/app/views/nyauth/reset_passwords/edit.html.erb +1 -1
- data/app/views/nyauth/sessions/new.html.erb +1 -1
- data/lib/nyauth/test/macros.rb +2 -0
- data/lib/nyauth/version.rb +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +1 -5
- data/spec/dummy/app/controllers/posts_controller.rb +2 -1
- data/spec/dummy/app/views/posts/index.html.erb +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +360 -4
- data/spec/dummy/log/test.log +8658 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/00R4IbuMWUgW0TswtkCnDqB8MUJqvz76FgkmbrLPTd8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/1-v7tFLPkD6uyCpAKjAKORwPg5YalyY-SYwjNGTiHQo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/122B1KZyQmgyJoX7uc4JINcUDUmcMHJsbf5JopBIpSg.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/2W23wCoDaNvkpc-htXrPJ_4wwRXsCB8sDUi-vlecXRY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8UAh9fJot2eROIl2PFflmIp2Q0G3oNNzBxCYx6AWaTw.cache +3 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8Ze9kDXrEQxOBazUvSE0NM5zLGZnHFsDskzK_P47vk4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ald0qisxC6krU6CCGUtsVQJwZ786HWf2a4VJnhi2Lrw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Bx8MbffT9WQGgl0DcTM5n11UlQabeTzIyqKGm2snGus.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CjFGeOmtoOvDUwEi78Mx3PtuchpMqlfecazo-n8RsAQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/DK6c5xJ8kSeXSqJlndPmMohu6AMbxDTYw3amSuVkoTs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E16A8LE9OYp6k-WBc2Egdmn6XL_-ipcmDOYBOfBITqs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EGILbSm92CBXW0Z6Mp6o2YygxS4b8Hhd2CW8igzKuRM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/FIPwj786RByADaWtmUkp2eeWQvQ_QmX1ER1sGGOKgqo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Fo9EHolUACmT7eKdJVmIzktbVgFRBZQkcCGHFfpD7u0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KiPxsMrAEr8OMX4H_Q8MSOgJ0PuFTQf2yX0S4kZsDVs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Tpj_x0CkqGAEMDgH-JGBkdkajznkLbbiVVZOxEqURxU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZM48tpiRiDxrKqKUvohWJfOeqwp5RsXgtKY84fW-qEE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZcwAlVnn77peLsFoZbCh7F7wpmxPhsehRs1frol6gfU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/h1z_izpQoHamMnv_RoNWN6gT2x3tY11ndWa7uVWkiaE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/k-V4Qz1zxawVTQoo00igdXRPgv4xOiV8fQsQtj8uDhA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lANr4VX8LDWQ3kMj0yoqyqiwK3SEqtIXkA-22639ZQQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mKfHoait9-j98PxObraQnsOWSk7xeFfrgppKbFtsUP0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s0L4Qc1LxOsV_VIoN33m851q4i5lQVM1ygIhke4UJhM.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sjZSTu90VegaTEOBnEbgI9A0_THfWp-_QVzTR7p7m_k.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/y7TMQhIN-uRk0HFOYLmEtgTZdktzieFoy6OGzULuesI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ysMIP1GiNEslwSMFx4V6kVDb4UFG1mgq0U7Pjh2AIzY.cache +1 -0
- data/spec/dummy/tmp/capybara/capybara-201508010214202383711168.html +19 -0
- data/spec/dummy/tmp/capybara/capybara-201508010214573127580777.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-201508010215518845010832.html +16 -0
- data/spec/featrues/nyauth/sessions_spec.rb +12 -0
- data/spec/helpers/nyauth/application_helper_spec.rb +50 -50
- data/spec/lib/generators/nyauth/tmp/app/views/nyauth/confirmation_requests/new.html.erb +1 -1
- data/spec/lib/generators/nyauth/tmp/app/views/nyauth/passwords/edit.html.erb +1 -1
- data/spec/lib/generators/nyauth/tmp/app/views/nyauth/registrations/new.html.erb +1 -1
- data/spec/lib/generators/nyauth/tmp/app/views/nyauth/reset_password_requests/new.html.erb +1 -1
- data/spec/lib/generators/nyauth/tmp/app/views/nyauth/reset_passwords/edit.html.erb +1 -1
- data/spec/lib/generators/nyauth/tmp/app/views/nyauth/sessions/new.html.erb +1 -1
- data/spec/rails_helper.rb +1 -2
- metadata +64 -3
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
"%����"m�J���S��E�j!�/�d�]�/[���
|
@@ -0,0 +1,2 @@
|
|
1
|
+
[o:Set:
|
2
|
+
@hash{ I"environment-version:ETTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery_ujs.js;TT
|
@@ -0,0 +1 @@
|
|
1
|
+
"%��Rm�v�S3.��O�L���ڹc�ƕq�=_j�
|
@@ -0,0 +1,3 @@
|
|
1
|
+
[o:Set:
|
2
|
+
@hash{
|
3
|
+
I"environment-version:ETTI"environment-paths;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI"zfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/application.css;TTI"jfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets;TT
|
@@ -0,0 +1 @@
|
|
1
|
+
I"�file:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=750202b725c4ec8618b9b62a6f9ade8aea347b8ebd5e7c7042c38c28a640502e:ET
|
@@ -0,0 +1 @@
|
|
1
|
+
I"�file:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=self&id=396813ef722485936af5c751bef055bc0e999227e9251904448b4d4bb4cd74c5:ET
|
@@ -0,0 +1 @@
|
|
1
|
+
I"�file:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/application.css?type=text/css&pipeline=self&id=baad254316b9119a95dcf23abfcfd20417bc9f29450937a16cb328fbf9d27669:ET
|
Binary file
|
@@ -0,0 +1,2 @@
|
|
1
|
+
[o:Set:
|
2
|
+
@hash{I"environment-version:ETTI"environment-paths;TTI"0processors:type=text/css&file_type=text/css;TTI"zfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/application.css;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI"jfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets;TT
|
@@ -0,0 +1,2 @@
|
|
1
|
+
[o:Set:
|
2
|
+
@hash{I"environment-version:ETTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"yfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/application.js;TTI"efile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/images;TTI"lfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/images/jquery;TTI"jfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts;TTI"qfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/jquery;TTI"jfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets;TTI"qfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/jquery;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery.js;TTI"pfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/images/jquery_ujs;TTI"ufile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/jquery_ujs;TTI"ufile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/jquery_ujs;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery_ujs;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery_ujs.js;TT
|
@@ -0,0 +1 @@
|
|
1
|
+
"%�RH���=kՎ�!1�d/_-�����6^�
|
@@ -0,0 +1 @@
|
|
1
|
+
"%X�p5����9~]~BK�����s��}^���%
|
@@ -0,0 +1 @@
|
|
1
|
+
"%z?��p}-�dO�G��9���9v�Y�fZ�
|
@@ -0,0 +1 @@
|
|
1
|
+
"%��B�����șo�$'�A�d��L���xR�U
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I"�file:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery_ujs.js?type=application/javascript&pipeline=self&id=c5ff56ae29fa61edfa01a729b34dce543c06165cdbfa5d01ce455e76783e05a4:ET
|
Binary file
|
Binary file
|
@@ -0,0 +1,2 @@
|
|
1
|
+
[o:Set:
|
2
|
+
@hash{ I"environment-version:ETTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery.js;TT
|
@@ -0,0 +1 @@
|
|
1
|
+
"%Ѱč@�����6H�uZoX�Z�gbh0W��V
|
@@ -0,0 +1,2 @@
|
|
1
|
+
[o:Set:
|
2
|
+
@hash{I"environment-version:ETTI"environment-paths;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;TTI"yfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/application.js;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery.js;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery_ujs.js;TTI"efile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/images;TTI"lfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/images/jquery;TTI"jfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts;TTI"qfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/jquery;TTI"jfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets;TTI"qfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/jquery;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery;TTI"pfile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/images/jquery_ujs;TTI"ufile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/jquery_ujs;TTI"ufile-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/jquery_ujs;TTI"�file-digest:///Users/koshikawa/repository/github.com/ppworks/nyauth/vendor/bundle/gems/jquery-rails-4.0.4/vendor/assets/javascripts/jquery_ujs;TT
|
@@ -0,0 +1 @@
|
|
1
|
+
I"�file:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/javascripts/application.js?type=application/javascript&id=1ccdfeb869112de2c400bb2d6f8031dc784e406553cb5dfae57d521c9176fc33:ET
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I"�file:///Users/koshikawa/repository/github.com/ppworks/nyauth/spec/dummy/app/assets/stylesheets/application.css?type=text/css&id=151e2a684234b8fa0aefe72b14a44f451e1be99791e1d9d6454b37de9c4a6473:ET
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<link rel="stylesheet" media="all" href="/assets/application.css" data-turbolinks-track="true" />
|
6
|
+
<script src="/assets/application.js" data-turbolinks-track="true"></script>
|
7
|
+
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<form class="new_session_service" id="new_session_service" action="/session" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" />
|
12
|
+
|
13
|
+
<input type="email" name="session_service[email]" id="session_service_email" />
|
14
|
+
<input type="password" name="session_service[password]" id="session_service_password" />
|
15
|
+
<input type="submit" name="commit" value="Sign in" />
|
16
|
+
</form>
|
17
|
+
<a href="/posts">URL helper on application</a>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<link rel="stylesheet" media="all" href="/assets/application.css" data-turbolinks-track="true" />
|
6
|
+
<script src="/assets/application.js" data-turbolinks-track="true"></script>
|
7
|
+
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
|
12
|
+
sign in success
|
13
|
+
<a href="/posts">URL helper on application</a>
|
14
|
+
<a class="pure-menu-link" rel="nofollow" data-method="delete" href="/session">Sign out</a>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -19,7 +19,19 @@ RSpec.describe 'Nyauth::Sessions' do
|
|
19
19
|
|
20
20
|
expect(page).to have_content('Invalid')
|
21
21
|
end
|
22
|
+
end
|
23
|
+
|
24
|
+
feature 'sign in & redirect to page accessed before sign in' do
|
25
|
+
background { visit posts_path }
|
22
26
|
|
27
|
+
scenario 'sign in user' do
|
28
|
+
fill_in('session_service_email', with: user.email)
|
29
|
+
fill_in('session_service_password', with: user.password)
|
30
|
+
click_button('Sign in')
|
31
|
+
|
32
|
+
expect(page).to have_content('sign in success')
|
33
|
+
expect(current_path).to eq posts_path
|
34
|
+
end
|
23
35
|
end
|
24
36
|
|
25
37
|
feature 'sign out' do
|
@@ -2,143 +2,143 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
RSpec.describe Nyauth::ApplicationHelper do
|
4
4
|
describe '#session_path_for' do
|
5
|
-
subject { helper.session_path_for(
|
5
|
+
subject { helper.session_path_for(nyauth_client_name) }
|
6
6
|
|
7
|
-
context 'when
|
8
|
-
let(:
|
7
|
+
context 'when nyauth_client_name is admin' do
|
8
|
+
let(:nyauth_client_name) { :admin }
|
9
9
|
it { is_expected.to eq '/admin/session' }
|
10
10
|
end
|
11
11
|
|
12
|
-
context 'when
|
13
|
-
let(:
|
12
|
+
context 'when nyauth_client_name is user' do
|
13
|
+
let(:nyauth_client_name) { :user }
|
14
14
|
it { is_expected.to eq '/session' }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '#new_session_path_for' do
|
19
|
-
subject { helper.new_session_path_for(
|
19
|
+
subject { helper.new_session_path_for(nyauth_client_name) }
|
20
20
|
|
21
|
-
context 'when
|
22
|
-
let(:
|
21
|
+
context 'when nyauth_client_name is admin' do
|
22
|
+
let(:nyauth_client_name) { :admin }
|
23
23
|
it { is_expected.to eq '/admin/session/new' }
|
24
24
|
end
|
25
25
|
|
26
|
-
context 'when
|
27
|
-
let(:
|
26
|
+
context 'when nyauth_client_name is user' do
|
27
|
+
let(:nyauth_client_name) { :user }
|
28
28
|
it { is_expected.to eq '/session/new' }
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe '#registration_path_for' do
|
33
|
-
subject { helper.registration_path_for(
|
33
|
+
subject { helper.registration_path_for(nyauth_client_name) }
|
34
34
|
|
35
|
-
context 'when
|
36
|
-
let(:
|
35
|
+
context 'when nyauth_client_name is admin' do
|
36
|
+
let(:nyauth_client_name) { :admin }
|
37
37
|
it { is_expected.to eq nil }
|
38
38
|
end
|
39
39
|
|
40
|
-
context 'when
|
41
|
-
let(:
|
40
|
+
context 'when nyauth_client_name is user' do
|
41
|
+
let(:nyauth_client_name) { :user }
|
42
42
|
it { is_expected.to eq '/registration' }
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
describe '#new_registration_path_for' do
|
47
|
-
subject { helper.new_registration_path_for(
|
47
|
+
subject { helper.new_registration_path_for(nyauth_client_name) }
|
48
48
|
|
49
|
-
context 'when
|
50
|
-
let(:
|
49
|
+
context 'when nyauth_client_name is admin' do
|
50
|
+
let(:nyauth_client_name) { :admin }
|
51
51
|
it { is_expected.to eq nil }
|
52
52
|
end
|
53
53
|
|
54
|
-
context 'when
|
55
|
-
let(:
|
54
|
+
context 'when nyauth_client_name is user' do
|
55
|
+
let(:nyauth_client_name) { :user }
|
56
56
|
it { is_expected.to eq '/registration/new' }
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
describe '#password_path_for' do
|
61
|
-
subject { helper.password_path_for(
|
61
|
+
subject { helper.password_path_for(nyauth_client_name) }
|
62
62
|
|
63
|
-
context 'when
|
64
|
-
let(:
|
63
|
+
context 'when nyauth_client_name is admin' do
|
64
|
+
let(:nyauth_client_name) { :admin }
|
65
65
|
it { is_expected.to eq "/admin/password" }
|
66
66
|
end
|
67
67
|
|
68
|
-
context 'when
|
69
|
-
let(:
|
68
|
+
context 'when nyauth_client_name is user' do
|
69
|
+
let(:nyauth_client_name) { :user }
|
70
70
|
it { is_expected.to eq "/password" }
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
74
|
describe '#new_confirmation_request_path_for' do
|
75
|
-
subject { helper.new_confirmation_request_path_for(
|
75
|
+
subject { helper.new_confirmation_request_path_for(nyauth_client_name) }
|
76
76
|
|
77
|
-
context 'when
|
78
|
-
let(:
|
77
|
+
context 'when nyauth_client_name is admin' do
|
78
|
+
let(:nyauth_client_name) { :admin }
|
79
79
|
it { is_expected.to eq nil }
|
80
80
|
end
|
81
81
|
|
82
|
-
context 'when
|
83
|
-
let(:
|
82
|
+
context 'when nyauth_client_name is user' do
|
83
|
+
let(:nyauth_client_name) { :user }
|
84
84
|
it { is_expected.to eq "/confirmation_requests/new" }
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
88
|
describe '#confirmation_path_for(:confirmation_key)' do
|
89
|
-
subject { helper.confirmation_path_for(
|
89
|
+
subject { helper.confirmation_path_for(nyauth_client_name, confirmation_key) }
|
90
90
|
let(:confirmation_key) { 'hogehoge' }
|
91
91
|
|
92
|
-
context 'when
|
93
|
-
let(:
|
92
|
+
context 'when nyauth_client_name is admin' do
|
93
|
+
let(:nyauth_client_name) { :admin }
|
94
94
|
it { is_expected.to eq nil }
|
95
95
|
end
|
96
96
|
|
97
|
-
context 'when
|
98
|
-
let(:
|
97
|
+
context 'when nyauth_client_name is user' do
|
98
|
+
let(:nyauth_client_name) { :user }
|
99
99
|
it { is_expected.to eq "/confirmations/#{confirmation_key}" }
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
103
|
describe '#reset_password_requests_path_for' do
|
104
|
-
subject { helper.reset_password_requests_path_for(
|
104
|
+
subject { helper.reset_password_requests_path_for(nyauth_client_name) }
|
105
105
|
|
106
|
-
context 'when
|
107
|
-
let(:
|
106
|
+
context 'when nyauth_client_name is admin' do
|
107
|
+
let(:nyauth_client_name) { :admin }
|
108
108
|
it { is_expected.to eq "/admin/reset_password_requests" }
|
109
109
|
end
|
110
110
|
|
111
|
-
context 'when
|
112
|
-
let(:
|
111
|
+
context 'when nyauth_client_name is user' do
|
112
|
+
let(:nyauth_client_name) { :user }
|
113
113
|
it { is_expected.to eq "/reset_password_requests" }
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
117
|
describe '#new_reset_password_request_path_for' do
|
118
|
-
subject { helper.new_reset_password_request_path_for(
|
118
|
+
subject { helper.new_reset_password_request_path_for(nyauth_client_name) }
|
119
119
|
|
120
|
-
context 'when
|
121
|
-
let(:
|
120
|
+
context 'when nyauth_client_name is admin' do
|
121
|
+
let(:nyauth_client_name) { :admin }
|
122
122
|
it { is_expected.to eq "/admin/reset_password_requests/new" }
|
123
123
|
end
|
124
124
|
|
125
|
-
context 'when
|
126
|
-
let(:
|
125
|
+
context 'when nyauth_client_name is user' do
|
126
|
+
let(:nyauth_client_name) { :user }
|
127
127
|
it { is_expected.to eq "/reset_password_requests/new" }
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
131
|
describe '#reset_password_path_for(:reset_password_key)' do
|
132
|
-
subject { helper.reset_password_path_for(
|
132
|
+
subject { helper.reset_password_path_for(nyauth_client_name, reset_password_key) }
|
133
133
|
let(:reset_password_key) { 'hogehoge' }
|
134
134
|
|
135
|
-
context 'when
|
136
|
-
let(:
|
135
|
+
context 'when nyauth_client_name is admin' do
|
136
|
+
let(:nyauth_client_name) { :admin }
|
137
137
|
it { is_expected.to eq "/admin/reset_passwords/#{reset_password_key}" }
|
138
138
|
end
|
139
139
|
|
140
|
-
context 'when
|
141
|
-
let(:
|
140
|
+
context 'when nyauth_client_name is user' do
|
141
|
+
let(:nyauth_client_name) { :user }
|
142
142
|
it { is_expected.to eq "/reset_passwords/#{reset_password_key}" }
|
143
143
|
end
|
144
144
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for
|
1
|
+
<%= form_for nyauth_client_class.new, url: confirmation_requests_path_for(nyauth_client_name) do |f| %>
|
2
2
|
<%= f.email_field :email %>
|
3
3
|
<%= f.submit 'request confirmation' %>
|
4
4
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for
|
1
|
+
<%= form_for nyauth_client_class.new, url: reset_password_requests_path_for(nyauth_client_name) do |f| %>
|
2
2
|
<%= f.text_field :email %>
|
3
3
|
<%= f.submit 'reset password' %>
|
4
4
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for @client, url: reset_password_path_for(
|
1
|
+
<%= form_for @client, url: reset_password_path_for(nyauth_client_name, params[:reset_password_key]) do |f| %>
|
2
2
|
<%= f.object.errors.full_messages %>
|
3
3
|
<%= f.password_field :password %>
|
4
4
|
<%= f.password_field :password_confirmation %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for @session_service, url: session_path_for(
|
1
|
+
<%= form_for @session_service, url: session_path_for(nyauth_client_name) do |f| %>
|
2
2
|
<%= f.object.errors.full_messages.join ',' %>
|
3
3
|
<%= f.email_field :email %>
|
4
4
|
<%= f.password_field :password %>
|
data/spec/rails_helper.rb
CHANGED
@@ -4,8 +4,7 @@ require 'spec_helper'
|
|
4
4
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
5
5
|
require 'rspec/rails'
|
6
6
|
require 'capybara/email/rspec'
|
7
|
-
require 'nyauth/test/
|
8
|
-
require 'nyauth/test/feature_macros'
|
7
|
+
require 'nyauth/test/macros'
|
9
8
|
|
10
9
|
Rails.application.config do
|
11
10
|
config.middleware.use RackSessionAccess::Middleware
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ppworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -54,8 +54,8 @@ files:
|
|
54
54
|
- MIT-LICENSE
|
55
55
|
- README.md
|
56
56
|
- Rakefile
|
57
|
-
- app/controllers/concerns/nyauth/application_concern.rb
|
58
57
|
- app/controllers/concerns/nyauth/client_concern.rb
|
58
|
+
- app/controllers/concerns/nyauth/controller_concern.rb
|
59
59
|
- app/controllers/concerns/nyauth/session_concern.rb
|
60
60
|
- app/controllers/nyauth/confirmation_requests_controller.rb
|
61
61
|
- app/controllers/nyauth/confirmations_controller.rb
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/nyauth/session_serializer.rb
|
107
107
|
- lib/nyauth/test/controller_macros.rb
|
108
108
|
- lib/nyauth/test/feature_macros.rb
|
109
|
+
- lib/nyauth/test/macros.rb
|
109
110
|
- lib/nyauth/version.rb
|
110
111
|
- spec/controllers/application_controller_spec.rb
|
111
112
|
- spec/dummy/README.rdoc
|
@@ -120,6 +121,7 @@ files:
|
|
120
121
|
- spec/dummy/app/models/user.rb
|
121
122
|
- spec/dummy/app/views/layouts/application.html.erb
|
122
123
|
- spec/dummy/app/views/pages/index.html.erb
|
124
|
+
- spec/dummy/app/views/posts/index.html.erb
|
123
125
|
- spec/dummy/bin/bundle
|
124
126
|
- spec/dummy/bin/rails
|
125
127
|
- spec/dummy/bin/rake
|
@@ -156,6 +158,32 @@ files:
|
|
156
158
|
- spec/dummy/public/422.html
|
157
159
|
- spec/dummy/public/500.html
|
158
160
|
- spec/dummy/public/favicon.ico
|
161
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/00R4IbuMWUgW0TswtkCnDqB8MUJqvz76FgkmbrLPTd8.cache
|
162
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/1-v7tFLPkD6uyCpAKjAKORwPg5YalyY-SYwjNGTiHQo.cache
|
163
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/122B1KZyQmgyJoX7uc4JINcUDUmcMHJsbf5JopBIpSg.cache
|
164
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/2W23wCoDaNvkpc-htXrPJ_4wwRXsCB8sDUi-vlecXRY.cache
|
165
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8UAh9fJot2eROIl2PFflmIp2Q0G3oNNzBxCYx6AWaTw.cache
|
166
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8Ze9kDXrEQxOBazUvSE0NM5zLGZnHFsDskzK_P47vk4.cache
|
167
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ald0qisxC6krU6CCGUtsVQJwZ786HWf2a4VJnhi2Lrw.cache
|
168
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Bx8MbffT9WQGgl0DcTM5n11UlQabeTzIyqKGm2snGus.cache
|
169
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CjFGeOmtoOvDUwEi78Mx3PtuchpMqlfecazo-n8RsAQ.cache
|
170
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/DK6c5xJ8kSeXSqJlndPmMohu6AMbxDTYw3amSuVkoTs.cache
|
171
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E16A8LE9OYp6k-WBc2Egdmn6XL_-ipcmDOYBOfBITqs.cache
|
172
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EGILbSm92CBXW0Z6Mp6o2YygxS4b8Hhd2CW8igzKuRM.cache
|
173
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/FIPwj786RByADaWtmUkp2eeWQvQ_QmX1ER1sGGOKgqo.cache
|
174
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Fo9EHolUACmT7eKdJVmIzktbVgFRBZQkcCGHFfpD7u0.cache
|
175
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KiPxsMrAEr8OMX4H_Q8MSOgJ0PuFTQf2yX0S4kZsDVs.cache
|
176
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Tpj_x0CkqGAEMDgH-JGBkdkajznkLbbiVVZOxEqURxU.cache
|
177
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZM48tpiRiDxrKqKUvohWJfOeqwp5RsXgtKY84fW-qEE.cache
|
178
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZcwAlVnn77peLsFoZbCh7F7wpmxPhsehRs1frol6gfU.cache
|
179
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/h1z_izpQoHamMnv_RoNWN6gT2x3tY11ndWa7uVWkiaE.cache
|
180
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/k-V4Qz1zxawVTQoo00igdXRPgv4xOiV8fQsQtj8uDhA.cache
|
181
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lANr4VX8LDWQ3kMj0yoqyqiwK3SEqtIXkA-22639ZQQ.cache
|
182
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mKfHoait9-j98PxObraQnsOWSk7xeFfrgppKbFtsUP0.cache
|
183
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s0L4Qc1LxOsV_VIoN33m851q4i5lQVM1ygIhke4UJhM.cache
|
184
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sjZSTu90VegaTEOBnEbgI9A0_THfWp-_QVzTR7p7m_k.cache
|
185
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/y7TMQhIN-uRk0HFOYLmEtgTZdktzieFoy6OGzULuesI.cache
|
186
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ysMIP1GiNEslwSMFx4V6kVDb4UFG1mgq0U7Pjh2AIzY.cache
|
159
187
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/1-v7tFLPkD6uyCpAKjAKORwPg5YalyY-SYwjNGTiHQo.cache
|
160
188
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/122B1KZyQmgyJoX7uc4JINcUDUmcMHJsbf5JopBIpSg.cache
|
161
189
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2W23wCoDaNvkpc-htXrPJ_4wwRXsCB8sDUi-vlecXRY.cache
|
@@ -182,6 +210,9 @@ files:
|
|
182
210
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/yYe_bLwTAh9hsZoH8SZgC6Dbr3nL_YOq9yPhiaOgbAA.cache
|
183
211
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/zR1DqIdG-kQRrFfJcMA5u5QqOpEtN3kg6ZKosd8od_4.cache
|
184
212
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/zsFy9esxJILHEYEl6_Z8DiVmOe3AtWOqYd4k46b-14s.cache
|
213
|
+
- spec/dummy/tmp/capybara/capybara-201508010214202383711168.html
|
214
|
+
- spec/dummy/tmp/capybara/capybara-201508010214573127580777.html
|
215
|
+
- spec/dummy/tmp/capybara/capybara-201508010215518845010832.html
|
185
216
|
- spec/factories/admins.rb
|
186
217
|
- spec/factories/users.rb
|
187
218
|
- spec/featrues/nyauth/confirmation_requests_spec.rb
|
@@ -251,6 +282,7 @@ test_files:
|
|
251
282
|
- spec/dummy/app/models/user.rb
|
252
283
|
- spec/dummy/app/views/layouts/application.html.erb
|
253
284
|
- spec/dummy/app/views/pages/index.html.erb
|
285
|
+
- spec/dummy/app/views/posts/index.html.erb
|
254
286
|
- spec/dummy/bin/bundle
|
255
287
|
- spec/dummy/bin/rails
|
256
288
|
- spec/dummy/bin/rake
|
@@ -289,6 +321,32 @@ test_files:
|
|
289
321
|
- spec/dummy/public/favicon.ico
|
290
322
|
- spec/dummy/Rakefile
|
291
323
|
- spec/dummy/README.rdoc
|
324
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/00R4IbuMWUgW0TswtkCnDqB8MUJqvz76FgkmbrLPTd8.cache
|
325
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/1-v7tFLPkD6uyCpAKjAKORwPg5YalyY-SYwjNGTiHQo.cache
|
326
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/122B1KZyQmgyJoX7uc4JINcUDUmcMHJsbf5JopBIpSg.cache
|
327
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/2W23wCoDaNvkpc-htXrPJ_4wwRXsCB8sDUi-vlecXRY.cache
|
328
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8UAh9fJot2eROIl2PFflmIp2Q0G3oNNzBxCYx6AWaTw.cache
|
329
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8Ze9kDXrEQxOBazUvSE0NM5zLGZnHFsDskzK_P47vk4.cache
|
330
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ald0qisxC6krU6CCGUtsVQJwZ786HWf2a4VJnhi2Lrw.cache
|
331
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Bx8MbffT9WQGgl0DcTM5n11UlQabeTzIyqKGm2snGus.cache
|
332
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CjFGeOmtoOvDUwEi78Mx3PtuchpMqlfecazo-n8RsAQ.cache
|
333
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/DK6c5xJ8kSeXSqJlndPmMohu6AMbxDTYw3amSuVkoTs.cache
|
334
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/E16A8LE9OYp6k-WBc2Egdmn6XL_-ipcmDOYBOfBITqs.cache
|
335
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EGILbSm92CBXW0Z6Mp6o2YygxS4b8Hhd2CW8igzKuRM.cache
|
336
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/FIPwj786RByADaWtmUkp2eeWQvQ_QmX1ER1sGGOKgqo.cache
|
337
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Fo9EHolUACmT7eKdJVmIzktbVgFRBZQkcCGHFfpD7u0.cache
|
338
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/h1z_izpQoHamMnv_RoNWN6gT2x3tY11ndWa7uVWkiaE.cache
|
339
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/k-V4Qz1zxawVTQoo00igdXRPgv4xOiV8fQsQtj8uDhA.cache
|
340
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KiPxsMrAEr8OMX4H_Q8MSOgJ0PuFTQf2yX0S4kZsDVs.cache
|
341
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lANr4VX8LDWQ3kMj0yoqyqiwK3SEqtIXkA-22639ZQQ.cache
|
342
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mKfHoait9-j98PxObraQnsOWSk7xeFfrgppKbFtsUP0.cache
|
343
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s0L4Qc1LxOsV_VIoN33m851q4i5lQVM1ygIhke4UJhM.cache
|
344
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sjZSTu90VegaTEOBnEbgI9A0_THfWp-_QVzTR7p7m_k.cache
|
345
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Tpj_x0CkqGAEMDgH-JGBkdkajznkLbbiVVZOxEqURxU.cache
|
346
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/y7TMQhIN-uRk0HFOYLmEtgTZdktzieFoy6OGzULuesI.cache
|
347
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ysMIP1GiNEslwSMFx4V6kVDb4UFG1mgq0U7Pjh2AIzY.cache
|
348
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZcwAlVnn77peLsFoZbCh7F7wpmxPhsehRs1frol6gfU.cache
|
349
|
+
- spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZM48tpiRiDxrKqKUvohWJfOeqwp5RsXgtKY84fW-qEE.cache
|
292
350
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/1-v7tFLPkD6uyCpAKjAKORwPg5YalyY-SYwjNGTiHQo.cache
|
293
351
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/122B1KZyQmgyJoX7uc4JINcUDUmcMHJsbf5JopBIpSg.cache
|
294
352
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2W23wCoDaNvkpc-htXrPJ_4wwRXsCB8sDUi-vlecXRY.cache
|
@@ -315,6 +373,9 @@ test_files:
|
|
315
373
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/yYe_bLwTAh9hsZoH8SZgC6Dbr3nL_YOq9yPhiaOgbAA.cache
|
316
374
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/zR1DqIdG-kQRrFfJcMA5u5QqOpEtN3kg6ZKosd8od_4.cache
|
317
375
|
- spec/dummy/tmp/cache/assets/test/sprockets/v3.0/zsFy9esxJILHEYEl6_Z8DiVmOe3AtWOqYd4k46b-14s.cache
|
376
|
+
- spec/dummy/tmp/capybara/capybara-201508010214202383711168.html
|
377
|
+
- spec/dummy/tmp/capybara/capybara-201508010214573127580777.html
|
378
|
+
- spec/dummy/tmp/capybara/capybara-201508010215518845010832.html
|
318
379
|
- spec/factories/admins.rb
|
319
380
|
- spec/factories/users.rb
|
320
381
|
- spec/featrues/nyauth/confirmation_requests_spec.rb
|