nyauth 0.2.1 → 0.2.2

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.
@@ -0,0 +1,27 @@
1
+ require 'rails_helper'
2
+ require 'generators/nyauth/nyauth_generator'
3
+
4
+ describe Nyauth::NyauthGenerator, type: :generator do
5
+ destination ::File.expand_path('../tmp/', __FILE__)
6
+
7
+ before do
8
+ prepare_destination
9
+ run_generator %w(user)
10
+ end
11
+
12
+ describe 'rails g nyauth User' do
13
+ it 'creates a test migration' do
14
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /t.string :email, null: false/
15
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /t.string :password_digest, null: false/
16
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /t.string :password_salt, null: false/
17
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /t.string :reset_password_key/
18
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /t.datetime :reset_password_key_expired_at/
19
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /#t.datetime :confirmed_at/
20
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /#t.string :confirmation_key/
21
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /#t.datetime :confirmation_key_expired_at/
22
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /add_index :users, :email, unique: true/
23
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /add_index :users, :reset_password_key, unique: true/
24
+ assert_migration 'db/migrate/add_nyauth_to_users.rb', /#add_index :users, :confirmation_key, unique: true/
25
+ end
26
+ end
27
+ end
data/spec/rails_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  ENV["RAILS_ENV"] ||= 'test'
2
+ ENV["NYAUTH_ENCRYPTION_SECRET"] = '1d5deeac604397c58c8ecdfecf1116e1c019a7355f612e67d8d40ac8fbf36b13de1e78dfffeecdf720aa953ab66d23718e21aee4cac5aa7939f34b89d5e6236b'
2
3
  require 'spec_helper'
3
4
  require File.expand_path("../dummy/config/environment", __FILE__)
4
5
  require 'rspec/rails'
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ppworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,6 +87,8 @@ files:
87
87
  - config/locales/en.yml
88
88
  - config/routes.rb
89
89
  - lib/generators/nyauth/install_generator.rb
90
+ - lib/generators/nyauth/nyauth_generator.rb
91
+ - lib/generators/nyauth/templates/migration.rb
90
92
  - lib/generators/nyauth/templates/nyauth_install_initializer.rb
91
93
  - lib/generators/nyauth/views_generator.rb
92
94
  - lib/nyauth.rb
@@ -172,6 +174,7 @@ files:
172
174
  - spec/featrues/url_helper_on_application_spec.rb
173
175
  - spec/helpers/nyauth/application_helper_spec.rb
174
176
  - spec/lib/generators/nyauth/install_generator_spec.rb
177
+ - spec/lib/generators/nyauth/nyauth_generator_spec.rb
175
178
  - spec/lib/generators/nyauth/tmp/app/views/nyauth/confirmation_requests/new.html.erb
176
179
  - spec/lib/generators/nyauth/tmp/app/views/nyauth/confirmations/edit.html.erb
177
180
  - spec/lib/generators/nyauth/tmp/app/views/nyauth/passwords/edit.html.erb
@@ -296,6 +299,7 @@ test_files:
296
299
  - spec/featrues/url_helper_on_application_spec.rb
297
300
  - spec/helpers/nyauth/application_helper_spec.rb
298
301
  - spec/lib/generators/nyauth/install_generator_spec.rb
302
+ - spec/lib/generators/nyauth/nyauth_generator_spec.rb
299
303
  - spec/lib/generators/nyauth/tmp/app/views/nyauth/confirmation_requests/new.html.erb
300
304
  - spec/lib/generators/nyauth/tmp/app/views/nyauth/confirmations/edit.html.erb
301
305
  - spec/lib/generators/nyauth/tmp/app/views/nyauth/passwords/edit.html.erb