introspective_admin 0.0.2 → 0.0.3
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/.travis.yml +16 -13
- data/Gemfile +1 -0
- data/Gemfile.lock +0 -2
- data/README.md +5 -1
- data/introspective_admin.gemspec +2 -2
- data/lib/introspective_admin/base.rb +9 -4
- data/lib/introspective_admin/version.rb +1 -1
- data/spec/admin/user_admin_spec.rb +64 -0
- data/spec/dummy/app/admin/user_admin.rb +4 -0
- data/spec/dummy/config/initializers/devise.rb +19 -16
- data/spec/dummy/config/locales/devise.en.yml +60 -0
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config/secrets.yml +1 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/rails_helper.rb +11 -0
- data/spec/support/blueprints.rb +1 -1
- metadata +6 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a04b4686389f2d6b41c43b26709343eccfa8a8e6
|
4
|
+
data.tar.gz: 76df689a036b43fe9f68358ca2ed1e0d19f31a33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974022287ba462dbbb425d70271db61a18d7cbe19ff3f2e32951db2078d4809ef630af64eba3426cc5d50defe0f2b5de14a79e79097d309924deb71505022824
|
7
|
+
data.tar.gz: 7135f978bfe933d6111bff64520ccf1e773ddb7a955c2aadc280e6dc1827e24cc92cdc0a5da99bd914317834e12c836be4820a57fe92f9f290aa670c8f1dae77
|
data/.travis.yml
CHANGED
@@ -3,10 +3,23 @@ install: bundle install --jobs=1 --retry=1
|
|
3
3
|
script:
|
4
4
|
- bundle install
|
5
5
|
- bundle exec rspec
|
6
|
+
|
6
7
|
rvm:
|
7
8
|
- 1.9
|
8
|
-
- 2.
|
9
|
-
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1
|
11
|
+
- 2.2
|
12
|
+
- rbx-2.5.8
|
13
|
+
- jruby-19mode
|
14
|
+
- jruby-9.0.4.0
|
15
|
+
- ruby-head
|
16
|
+
- jruby-head
|
17
|
+
|
18
|
+
matrix:
|
19
|
+
allow_failures:
|
20
|
+
- rvm: ruby-head
|
21
|
+
- rvm: jruby-head
|
22
|
+
|
10
23
|
env:
|
11
24
|
matrix:
|
12
25
|
- RAILS=3.2.22
|
@@ -15,17 +28,7 @@ env:
|
|
15
28
|
- RAILS=master
|
16
29
|
global:
|
17
30
|
- JRUBY_OPTS="-J-Xmx1024m --debug"
|
18
|
-
|
19
|
-
fast_finish: true
|
20
|
-
exclude:
|
21
|
-
- rvm: 2.2.3
|
22
|
-
env: RAILS=3.2.22
|
23
|
-
- rvm: jruby-9.0.0.0
|
24
|
-
env: RAILS=3.2.22
|
25
|
-
- rvm: 1.9
|
26
|
-
env: RAILS=master
|
27
|
-
allow_failures:
|
28
|
-
- env: RAILS=master
|
31
|
+
|
29
32
|
notifications:
|
30
33
|
email:
|
31
34
|
recipients:
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -68,7 +68,6 @@ GEM
|
|
68
68
|
sass (~> 3.4)
|
69
69
|
thor (~> 0.19)
|
70
70
|
builder (3.2.2)
|
71
|
-
byebug (6.0.2)
|
72
71
|
coffee-rails (4.1.0)
|
73
72
|
coffee-script (>= 2.2.0)
|
74
73
|
railties (>= 4.0.0, < 5.0)
|
@@ -212,7 +211,6 @@ PLATFORMS
|
|
212
211
|
|
213
212
|
DEPENDENCIES
|
214
213
|
activeadmin!
|
215
|
-
byebug
|
216
214
|
devise
|
217
215
|
devise-async
|
218
216
|
introspective_admin!
|
data/README.md
CHANGED
@@ -32,6 +32,10 @@ And bundle install. In app/admin/my_admin.rb:
|
|
32
32
|
|
33
33
|
```
|
34
34
|
class MyAdmin < IntrospectiveAdmin::Base
|
35
|
+
def self.include_virtual_attributes
|
36
|
+
%w(password)
|
37
|
+
end
|
38
|
+
|
35
39
|
def self.exclude_params
|
36
40
|
%w(fields to exclude from the admin screen)
|
37
41
|
end
|
@@ -44,7 +48,7 @@ class MyAdmin < IntrospectiveAdmin::Base
|
|
44
48
|
end
|
45
49
|
```
|
46
50
|
|
47
|
-
Registering MyModel will set up the index, show, and form configurations for every attribute and nested association on the model excluding those in MyAdmin.exclude_params
|
51
|
+
Registering MyModel will set up the index, show, and form configurations for every attribute, virtual attribute listed in MyAdmin.include_virtual_attributes (e.g. a password field for a Devise model), and nested association on the model excluding those in MyAdmin.exclude_params. It will link to associated records (if they have ActiveAdmin screens), perform eager loading of nested associations, and permit parameters for every non-excluded attribute on the model.
|
48
52
|
|
49
53
|
Customizing select box options for associations is done by adding an
|
50
54
|
"options_for_X" class method on the administrated model:
|
data/introspective_admin.gemspec
CHANGED
@@ -23,11 +23,11 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency 'sass-rails'
|
24
24
|
|
25
25
|
if RUBY_PLATFORM == 'java'
|
26
|
-
s.add_development_dependency "
|
26
|
+
s.add_development_dependency "activerecord-jdbcsqlite3-adapter"
|
27
27
|
else
|
28
28
|
s.add_development_dependency "sqlite3"
|
29
29
|
if RUBY_VERSION > '2.0.0'
|
30
|
-
s.add_development_dependency 'byebug'
|
30
|
+
#s.add_development_dependency 'byebug'
|
31
31
|
end
|
32
32
|
end
|
33
33
|
s.add_development_dependency "rspec-rails", '>= 3.0'
|
@@ -24,6 +24,10 @@ module IntrospectiveAdmin
|
|
24
24
|
[] # do not display the field in the index page and forms.
|
25
25
|
end
|
26
26
|
|
27
|
+
def include_virtual_attributes
|
28
|
+
[] #
|
29
|
+
end
|
30
|
+
|
27
31
|
def polymorphic?(model,column)
|
28
32
|
(model.reflections[column.sub(/_id$/,'')].try(:options)||{})[:polymorphic]
|
29
33
|
end
|
@@ -31,13 +35,13 @@ module IntrospectiveAdmin
|
|
31
35
|
def column_list(model)
|
32
36
|
model.columns.map {|c|
|
33
37
|
c.name.sub(/(_type|_id)$/,'')
|
34
|
-
}.uniq-['created_at','updated_at']-exclude_params
|
38
|
+
}.uniq-['created_at','updated_at']-exclude_params+include_virtual_attributes
|
35
39
|
end
|
36
40
|
|
37
41
|
def params_list(model)
|
38
42
|
model.columns.map {|c|
|
39
43
|
polymorphic?(model,c.name) ? c.name.sub(/_id$/,'')+"_assign" : c.name
|
40
|
-
}
|
44
|
+
}+include_virtual_attributes
|
41
45
|
end
|
42
46
|
|
43
47
|
def link_record(record)
|
@@ -58,7 +62,9 @@ module IntrospectiveAdmin
|
|
58
62
|
|
59
63
|
klass = self
|
60
64
|
model_name = model.to_s.underscore
|
61
|
-
nested_config = Hash[model.nested_attributes_options.
|
65
|
+
nested_config = Hash[model.nested_attributes_options.reject {|name,o|
|
66
|
+
klass.exclude_params.include?("#{name}_attributes")
|
67
|
+
}.map {|assoc,options|
|
62
68
|
reflection = model.reflections[assoc.to_s]
|
63
69
|
reflection_class = reflection.class_name.constantize
|
64
70
|
# merge the options of the nested attribute and relationship declarations
|
@@ -71,7 +77,6 @@ module IntrospectiveAdmin
|
|
71
77
|
[assoc, options]
|
72
78
|
}]
|
73
79
|
|
74
|
-
|
75
80
|
ActiveAdmin.register model do
|
76
81
|
controller do
|
77
82
|
def scoped_collection
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe Admin::UsersController, :type => :controller do
|
4
|
+
render_views
|
5
|
+
|
6
|
+
before :each do
|
7
|
+
user = double('user')
|
8
|
+
allow(request.env['warden']).to receive(:authenticate!) { user }
|
9
|
+
allow(controller).to receive(:current_user) { user }
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "GET index" do
|
13
|
+
it "finds all users" do
|
14
|
+
u = User.make!
|
15
|
+
get :index
|
16
|
+
response.status.should == 200
|
17
|
+
assigns(:users).include?(u).should == true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "SHOW record" do
|
22
|
+
it "finds the record" do
|
23
|
+
u = User.make!
|
24
|
+
get :show, id: u.id
|
25
|
+
response.status.should == 200
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "NEW record" do
|
30
|
+
it "renders the form for a new record" do
|
31
|
+
get :new
|
32
|
+
response.status.should == 200
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "CREATE record" do
|
37
|
+
it "creates the record" do
|
38
|
+
post :create, user: { first_name: 'first', last_name: 'last', email: 'test@blah.com', password: "abcd1234" }
|
39
|
+
response.should redirect_to action: :show, id: User.last.id
|
40
|
+
u = User.last
|
41
|
+
u.first_name.should == 'first'
|
42
|
+
u.last_name.should == 'last'
|
43
|
+
u.email.should == 'test@blah.com'
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "EDIT record" do
|
49
|
+
it "renders the edit form for an existing record" do
|
50
|
+
r = User.make!
|
51
|
+
get :edit, id: r.id
|
52
|
+
response.status.should == 200
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "UPDATE record" do
|
57
|
+
it "updates the record" do
|
58
|
+
u = User.make!
|
59
|
+
put :update, id: u.id, user: { first_name: "New Name" }
|
60
|
+
response.should redirect_to action: :show, id: u.id
|
61
|
+
User.find(u.id).first_name.should == "New Name"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -1,4 +1,8 @@
|
|
1
1
|
class UserAdmin < IntrospectiveAdmin::Base
|
2
|
+
def self.include_virtual_attributes
|
3
|
+
%w(password)
|
4
|
+
end
|
5
|
+
|
2
6
|
def self.exclude_params
|
3
7
|
%w(reset_password_at current_sign_in_at current_sign_in_ip remember_created_at sign_in_count encrypted_password reset_password_sent_at reset_password_token password authentication_token unlock_token failed_attempts last_sign_in_at locked_at last_sign_in_ip)
|
4
8
|
end
|
@@ -5,13 +5,15 @@ Devise.setup do |config|
|
|
5
5
|
# The secret key used by Devise. Devise uses this key to generate
|
6
6
|
# random tokens. Changing this key will render invalid all existing
|
7
7
|
# confirmation, reset password and unlock tokens in the database.
|
8
|
-
|
8
|
+
# Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
|
9
|
+
# by default. You can change it below and use your own secret key.
|
10
|
+
config.secret_key = '16f3eba693fcd1a875d60e96961501c7e78eb7167a68bdff3bb0fa14b66f985f0e07cccbb2c38ca105b71a4ab051adf35d5f7b368172e02a138d1cc8966fe530'
|
9
11
|
|
10
12
|
# ==> Mailer Configuration
|
11
13
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
12
14
|
# note that it will be overwritten if you use your own mailer class
|
13
15
|
# with default "from" parameter.
|
14
|
-
config.mailer_sender = '
|
16
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
15
17
|
|
16
18
|
# Configure the class responsible to send e-mails.
|
17
19
|
# config.mailer = 'Devise::Mailer'
|
@@ -30,7 +32,7 @@ Devise.setup do |config|
|
|
30
32
|
# session. If you need permissions, you should implement that in a before filter.
|
31
33
|
# You can also supply a hash where the value is a boolean determining whether
|
32
34
|
# or not authentication should be aborted when the value is not present.
|
33
|
-
# config.authentication_keys = [
|
35
|
+
# config.authentication_keys = [:email]
|
34
36
|
|
35
37
|
# Configure parameters from the request object used for authentication. Each entry
|
36
38
|
# given should be a request method and it will automatically be passed to the
|
@@ -42,12 +44,12 @@ Devise.setup do |config|
|
|
42
44
|
# Configure which authentication keys should be case-insensitive.
|
43
45
|
# These keys will be downcased upon creating or modifying a user and when used
|
44
46
|
# to authenticate or find a user. Default is :email.
|
45
|
-
config.case_insensitive_keys = [
|
47
|
+
config.case_insensitive_keys = [:email]
|
46
48
|
|
47
49
|
# Configure which authentication keys should have whitespace stripped.
|
48
50
|
# These keys will have whitespace before and after removed upon creating or
|
49
51
|
# modifying a user and when used to authenticate or find a user. Default is :email.
|
50
|
-
config.strip_whitespace_keys = [
|
52
|
+
config.strip_whitespace_keys = [:email]
|
51
53
|
|
52
54
|
# Tell if authentication through request.params is enabled. True by default.
|
53
55
|
# It can be set to an array that will enable params authentication only for the
|
@@ -62,7 +64,7 @@ Devise.setup do |config|
|
|
62
64
|
# :database = Support basic authentication with authentication key + password
|
63
65
|
# config.http_authenticatable = false
|
64
66
|
|
65
|
-
# If
|
67
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
66
68
|
# config.http_authenticatable_on_xhr = true
|
67
69
|
|
68
70
|
# The realm used in Http Basic Authentication. 'Application' by default.
|
@@ -98,7 +100,7 @@ Devise.setup do |config|
|
|
98
100
|
config.stretches = Rails.env.test? ? 1 : 10
|
99
101
|
|
100
102
|
# Setup a pepper to generate the encrypted password.
|
101
|
-
# config.pepper = '
|
103
|
+
# config.pepper = '7d483ef48a0c859652bd623cba800fd76a8a45662f246b2dd2602b02635dbdf935ce0384f1c3bf13fdbe23880eab9f5fdf87fa46f92a1f36098f6051313383fe'
|
102
104
|
|
103
105
|
# ==> Configuration for :confirmable
|
104
106
|
# A period that the user is allowed to access the website even without
|
@@ -123,7 +125,7 @@ Devise.setup do |config|
|
|
123
125
|
config.reconfirmable = true
|
124
126
|
|
125
127
|
# Defines which key will be used when confirming an account
|
126
|
-
# config.confirmation_keys = [
|
128
|
+
# config.confirmation_keys = [:email]
|
127
129
|
|
128
130
|
# ==> Configuration for :rememberable
|
129
131
|
# The time the user will be remembered without asking for credentials again.
|
@@ -141,7 +143,7 @@ Devise.setup do |config|
|
|
141
143
|
|
142
144
|
# ==> Configuration for :validatable
|
143
145
|
# Range for password length.
|
144
|
-
config.password_length =
|
146
|
+
config.password_length = 8..72
|
145
147
|
|
146
148
|
# Email regex used to validate email formats. It simply asserts that
|
147
149
|
# one (and only one) @ exists in the given string. This is mainly
|
@@ -153,9 +155,6 @@ Devise.setup do |config|
|
|
153
155
|
# time the user will be asked for credentials again. Default is 30 minutes.
|
154
156
|
# config.timeout_in = 30.minutes
|
155
157
|
|
156
|
-
# If true, expires auth token on session timeout.
|
157
|
-
# config.expire_auth_token_on_timeout = false
|
158
|
-
|
159
158
|
# ==> Configuration for :lockable
|
160
159
|
# Defines which strategy will be used to lock an account.
|
161
160
|
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
@@ -163,7 +162,7 @@ Devise.setup do |config|
|
|
163
162
|
# config.lock_strategy = :failed_attempts
|
164
163
|
|
165
164
|
# Defines which key will be used when locking and unlocking an account
|
166
|
-
# config.unlock_keys = [
|
165
|
+
# config.unlock_keys = [:email]
|
167
166
|
|
168
167
|
# Defines which strategy will be used to unlock an account.
|
169
168
|
# :email = Sends an unlock link to the user email
|
@@ -180,18 +179,22 @@ Devise.setup do |config|
|
|
180
179
|
# config.unlock_in = 1.hour
|
181
180
|
|
182
181
|
# Warn on the last attempt before the account is locked.
|
183
|
-
# config.last_attempt_warning =
|
182
|
+
# config.last_attempt_warning = true
|
184
183
|
|
185
184
|
# ==> Configuration for :recoverable
|
186
185
|
#
|
187
186
|
# Defines which key will be used when recovering the password for an account
|
188
|
-
# config.reset_password_keys = [
|
187
|
+
# config.reset_password_keys = [:email]
|
189
188
|
|
190
189
|
# Time interval you can reset your password with a reset password key.
|
191
190
|
# Don't put a too small interval or your users won't have the time to
|
192
191
|
# change their passwords.
|
193
192
|
config.reset_password_within = 6.hours
|
194
193
|
|
194
|
+
# When set to false, does not sign a user in automatically after their password is
|
195
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
196
|
+
# config.sign_in_after_reset_password = true
|
197
|
+
|
195
198
|
# ==> Configuration for :encryptable
|
196
199
|
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
197
200
|
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
@@ -254,7 +257,7 @@ Devise.setup do |config|
|
|
254
257
|
# The router that invoked `devise_for`, in the example above, would be:
|
255
258
|
# config.router_name = :my_engine
|
256
259
|
#
|
257
|
-
# When using
|
260
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
258
261
|
# so you need to do it manually. For the users scope, it would be:
|
259
262
|
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
260
263
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
omniauth_callbacks:
|
27
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
28
|
+
success: "Successfully authenticated from %{kind} account."
|
29
|
+
passwords:
|
30
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
31
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
32
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
33
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
34
|
+
updated_not_active: "Your password has been changed successfully."
|
35
|
+
registrations:
|
36
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
37
|
+
signed_up: "Welcome! You have signed up successfully."
|
38
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
39
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
40
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
41
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
42
|
+
updated: "Your account has been updated successfully."
|
43
|
+
sessions:
|
44
|
+
signed_in: "Signed in successfully."
|
45
|
+
signed_out: "Signed out successfully."
|
46
|
+
already_signed_out: "Signed out successfully."
|
47
|
+
unlocks:
|
48
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
49
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
50
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
51
|
+
errors:
|
52
|
+
messages:
|
53
|
+
already_confirmed: "was already confirmed, please try signing in"
|
54
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
55
|
+
expired: "has expired, please request a new one"
|
56
|
+
not_found: "not found"
|
57
|
+
not_locked: "was not locked"
|
58
|
+
not_saved:
|
59
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
60
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -16,7 +16,5 @@ development:
|
|
16
16
|
test:
|
17
17
|
secret_key_base: ca9d4587a556cfc28464dcf7f9d73b396e53b814cd339a469bc817011485510d3a9d1d6a7fa08f65cce65bcd55727a7110de0077a952f50ce58a956b255c6903
|
18
18
|
|
19
|
-
# Do not keep production secrets in the repository,
|
20
|
-
# instead read values from the environment.
|
21
19
|
production:
|
22
|
-
secret_key_base:
|
20
|
+
secret_key_base: 993285c8b7c44547fa1cf053bf88fa75d6f8fdf33d8e033b8915e025b252c620ef102e9c16a463c3a60b356cf5b57f27ebb35eb90f4f2674bda82c69cac4142d
|
Binary file
|
data/spec/rails_helper.rb
CHANGED
@@ -3,9 +3,20 @@ require File.expand_path("../dummy/config/environment", __FILE__)
|
|
3
3
|
require 'rspec/rails'
|
4
4
|
Dir[Rails.root.join("../support/**/*.rb")].each { |f| require f }
|
5
5
|
|
6
|
+
|
6
7
|
RSpec.configure do |config|
|
7
8
|
config.include Devise::TestHelpers, type: :controller
|
8
9
|
config.use_transactional_fixtures = true
|
9
10
|
config.infer_spec_type_from_file_location!
|
10
11
|
config.expect_with(:rspec) { |c| c.syntax = :should }
|
11
12
|
end
|
13
|
+
|
14
|
+
# Devise isn't initializing properly in the dummy app, stub it out for now.
|
15
|
+
Devise.token_generator ||= Devise::TokenGenerator.new(Devise::CachingKeyGenerator.new(Devise::KeyGenerator.new(Devise.secret_key)))
|
16
|
+
class Devise::Mailer
|
17
|
+
def self.confirmation_instructions(a,b,c)
|
18
|
+
Devise::Mailer.new
|
19
|
+
end
|
20
|
+
def deliver
|
21
|
+
end
|
22
|
+
end
|
data/spec/support/blueprints.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: introspective_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Buermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass-rails
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: byebug
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec-rails
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,6 +147,7 @@ files:
|
|
161
147
|
- spec/admin/job_admin_spec.rb
|
162
148
|
- spec/admin/location_admin_spec.rb
|
163
149
|
- spec/admin/project__admin_spec.rb
|
150
|
+
- spec/admin/user_admin_spec.rb
|
164
151
|
- spec/dummy/README.rdoc
|
165
152
|
- spec/dummy/Rakefile
|
166
153
|
- spec/dummy/app/admin/company_admin.rb
|
@@ -217,6 +204,7 @@ files:
|
|
217
204
|
- spec/dummy/config/initializers/mime_types.rb
|
218
205
|
- spec/dummy/config/initializers/session_store.rb
|
219
206
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
207
|
+
- spec/dummy/config/locales/devise.en.yml
|
220
208
|
- spec/dummy/config/locales/en.yml
|
221
209
|
- spec/dummy/config/routes.rb
|
222
210
|
- spec/dummy/config/secrets.yml
|
@@ -285,6 +273,7 @@ test_files:
|
|
285
273
|
- spec/admin/job_admin_spec.rb
|
286
274
|
- spec/admin/location_admin_spec.rb
|
287
275
|
- spec/admin/project__admin_spec.rb
|
276
|
+
- spec/admin/user_admin_spec.rb
|
288
277
|
- spec/dummy/README.rdoc
|
289
278
|
- spec/dummy/Rakefile
|
290
279
|
- spec/dummy/app/admin/company_admin.rb
|
@@ -341,6 +330,7 @@ test_files:
|
|
341
330
|
- spec/dummy/config/initializers/mime_types.rb
|
342
331
|
- spec/dummy/config/initializers/session_store.rb
|
343
332
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
333
|
+
- spec/dummy/config/locales/devise.en.yml
|
344
334
|
- spec/dummy/config/locales/en.yml
|
345
335
|
- spec/dummy/config/routes.rb
|
346
336
|
- spec/dummy/config/secrets.yml
|