nyauth 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/nyauth/confirmation_requests_controller.rb +12 -9
  3. data/app/controllers/nyauth/registrations_controller.rb +7 -7
  4. data/app/controllers/nyauth/reset_password_requests_controller.rb +12 -9
  5. data/app/controllers/nyauth/sessions_controller.rb +7 -7
  6. data/app/services/nyauth/confirmation_request.rb +19 -0
  7. data/app/services/nyauth/registration.rb +22 -0
  8. data/app/services/nyauth/reset_password_request.rb +19 -0
  9. data/app/services/nyauth/{session_service.rb → session.rb} +4 -4
  10. data/app/views/nyauth/confirmation_requests/new.html.erb +1 -1
  11. data/app/views/nyauth/registrations/new.html.erb +1 -1
  12. data/app/views/nyauth/reset_password_requests/new.html.erb +1 -1
  13. data/app/views/nyauth/sessions/new.html.erb +1 -1
  14. data/config/locales/en.yml +1 -0
  15. data/config/locales/ja.yml +1 -0
  16. data/lib/nyauth/version.rb +1 -1
  17. data/spec/dummy/db/development.sqlite3 +0 -0
  18. data/spec/dummy/db/test.sqlite3 +0 -0
  19. data/spec/dummy/log/development.log +3645 -0
  20. data/spec/dummy/log/test.log +10449 -0
  21. data/spec/dummy/tmp/pids/server.pid +1 -0
  22. data/spec/featrues/nyauth/confirmation_requests_spec.rb +2 -2
  23. data/spec/featrues/nyauth/registrations_spec.rb +3 -3
  24. data/spec/featrues/nyauth/reset_password_requests_spec.rb +2 -2
  25. data/spec/featrues/nyauth/sessions_spec.rb +6 -6
  26. data/spec/lib/generators/nyauth/tmp/app/views/nyauth/confirmation_requests/new.html.erb +1 -1
  27. data/spec/lib/generators/nyauth/tmp/app/views/nyauth/registrations/new.html.erb +1 -1
  28. data/spec/lib/generators/nyauth/tmp/app/views/nyauth/reset_password_requests/new.html.erb +1 -1
  29. data/spec/lib/generators/nyauth/tmp/app/views/nyauth/sessions/new.html.erb +1 -1
  30. metadata +8 -4
  31. data/app/services/nyauth/confirmation_request_service.rb +0 -15
@@ -0,0 +1 @@
1
+ 86775
@@ -9,7 +9,7 @@ RSpec.describe 'Nyauth::ConfirmationRequests' do
9
9
  end
10
10
 
11
11
  scenario 'request & confirm' do
12
- fill_in('user_email', with: user.email)
12
+ fill_in('confirmation_request_email', with: user.email)
13
13
  click_button('request confirmation')
14
14
 
15
15
  open_email(user.email)
@@ -21,7 +21,7 @@ RSpec.describe 'Nyauth::ConfirmationRequests' do
21
21
  end
22
22
 
23
23
  scenario 'request expired' do
24
- fill_in('user_email', with: user.email)
24
+ fill_in('confirmation_request_email', with: user.email)
25
25
  click_button('request confirmation')
26
26
 
27
27
  Timecop.freeze(Time.current + 3.hours) do
@@ -7,9 +7,9 @@ RSpec.describe 'Nyauth::Registrations' do
7
7
  background { visit nyauth.new_registration_path }
8
8
 
9
9
  scenario 'create user' do
10
- fill_in('user_email', with: user.email)
11
- fill_in('user_password', with: user.password)
12
- fill_in('user_password_confirmation', with: user.password)
10
+ fill_in('registration_email', with: user.email)
11
+ fill_in('registration_password', with: user.password)
12
+ fill_in('registration_password_confirmation', with: user.password)
13
13
  click_button('Sign up')
14
14
 
15
15
  expect(page).to have_content('registration success')
@@ -10,7 +10,7 @@ RSpec.describe 'Nyauth::NewPasswordRequests' do
10
10
  end
11
11
 
12
12
  scenario 'request & set reset password' do
13
- fill_in('user_email', with: user.email)
13
+ fill_in('reset_password_request_email', with: user.email)
14
14
  click_button('reset password')
15
15
 
16
16
  open_email(user.email)
@@ -25,7 +25,7 @@ RSpec.describe 'Nyauth::NewPasswordRequests' do
25
25
  end
26
26
 
27
27
  scenario 'request expired' do
28
- fill_in('user_email', with: user.email)
28
+ fill_in('reset_password_request_email', with: user.email)
29
29
  click_button('reset password')
30
30
 
31
31
  Timecop.freeze(Time.current + 3.hours) do
@@ -7,8 +7,8 @@ RSpec.describe 'Nyauth::Sessions' do
7
7
  background { visit nyauth.new_session_path }
8
8
 
9
9
  scenario 'sign in user' do
10
- fill_in('session_service_email', with: user.email)
11
- fill_in('session_service_password', with: user.password)
10
+ fill_in('session_email', with: user.email)
11
+ fill_in('session_password', with: user.password)
12
12
  click_button('Sign in')
13
13
 
14
14
  expect(page).to have_content('sign in success')
@@ -25,8 +25,8 @@ RSpec.describe 'Nyauth::Sessions' do
25
25
  background { visit posts_path }
26
26
 
27
27
  scenario 'sign in user' do
28
- fill_in('session_service_email', with: user.email)
29
- fill_in('session_service_password', with: user.password)
28
+ fill_in('session_email', with: user.email)
29
+ fill_in('session_password', with: user.password)
30
30
  click_button('Sign in')
31
31
 
32
32
  expect(page).to have_content('sign in success')
@@ -57,8 +57,8 @@ RSpec.describe 'Nyauth::Sessions' do
57
57
  background { visit new_admin_session_path }
58
58
 
59
59
  scenario 'sign in admin' do
60
- fill_in('session_service_email', with: admin.email)
61
- fill_in('session_service_password', with: admin.password)
60
+ fill_in('session_email', with: admin.email)
61
+ fill_in('session_password', with: admin.password)
62
62
  click_button('Sign in')
63
63
 
64
64
  expect(page).to have_content('sign in success')
@@ -1,4 +1,4 @@
1
- <%= form_for nyauth_client_class.new, url: confirmation_requests_path_for(nyauth_client_name) do |f| %>
1
+ <%= form_for @service, 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 @client, url: registration_path_for(nyauth_client_name) do |f| %>
1
+ <%= form_for @service, url: registration_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 %>
@@ -1,4 +1,4 @@
1
- <%= form_for nyauth_client_class.new, url: reset_password_requests_path_for(nyauth_client_name) do |f| %>
1
+ <%= form_for @service, 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 @session_service, url: session_path_for(nyauth_client_name) do |f| %>
1
+ <%= form_for @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 %>
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.3.0
4
+ version: 0.4.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-08-01 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -72,8 +72,10 @@ files:
72
72
  - app/models/concerns/nyauth/reset_password_ability.rb
73
73
  - app/responders/nyauth/app_responder.rb
74
74
  - app/responders/nyauth/confirmation_responder.rb
75
- - app/services/nyauth/confirmation_request_service.rb
76
- - app/services/nyauth/session_service.rb
75
+ - app/services/nyauth/confirmation_request.rb
76
+ - app/services/nyauth/registration.rb
77
+ - app/services/nyauth/reset_password_request.rb
78
+ - app/services/nyauth/session.rb
77
79
  - app/views/layouts/nyauth/mailer.html.erb
78
80
  - app/views/layouts/nyauth/mailer.text.erb
79
81
  - app/views/nyauth/confirmation_requests/new.html.erb
@@ -213,6 +215,7 @@ files:
213
215
  - spec/dummy/tmp/capybara/capybara-201508010214202383711168.html
214
216
  - spec/dummy/tmp/capybara/capybara-201508010214573127580777.html
215
217
  - spec/dummy/tmp/capybara/capybara-201508010215518845010832.html
218
+ - spec/dummy/tmp/pids/server.pid
216
219
  - spec/factories/admins.rb
217
220
  - spec/factories/users.rb
218
221
  - spec/featrues/nyauth/confirmation_requests_spec.rb
@@ -376,6 +379,7 @@ test_files:
376
379
  - spec/dummy/tmp/capybara/capybara-201508010214202383711168.html
377
380
  - spec/dummy/tmp/capybara/capybara-201508010214573127580777.html
378
381
  - spec/dummy/tmp/capybara/capybara-201508010215518845010832.html
382
+ - spec/dummy/tmp/pids/server.pid
379
383
  - spec/factories/admins.rb
380
384
  - spec/factories/users.rb
381
385
  - spec/featrues/nyauth/confirmation_requests_spec.rb
@@ -1,15 +0,0 @@
1
- module Nyauth
2
- class ConfimationRequestService
3
- include ActiveModel::Model
4
- attr_reader :client
5
-
6
- def initialize(client)
7
- @client = client
8
- end
9
-
10
- def save
11
- client.request_confirmation
12
- client.save
13
- end
14
- end
15
- end