dougjohnston-devise_invitable 0.4.rc
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +117 -0
- data/LICENSE +20 -0
- data/README.rdoc +187 -0
- data/Rakefile +57 -0
- data/app/controllers/devise/invitations_controller.rb +47 -0
- data/app/views/devise/invitations/edit.html.erb +14 -0
- data/app/views/devise/invitations/new.html.erb +12 -0
- data/app/views/devise/mailer/invitation.html.erb +8 -0
- data/app/views/devise/mailer/invitation_instructions.html.erb +8 -0
- data/config/locales/en.yml +9 -0
- data/devise_invitable.gemspec +157 -0
- data/lib/devise_invitable.rb +16 -0
- data/lib/devise_invitable/controllers/helpers.rb +7 -0
- data/lib/devise_invitable/controllers/url_helpers.rb +24 -0
- data/lib/devise_invitable/mailer.rb +14 -0
- data/lib/devise_invitable/model.rb +130 -0
- data/lib/devise_invitable/rails.rb +13 -0
- data/lib/devise_invitable/routes.rb +13 -0
- data/lib/devise_invitable/schema.rb +33 -0
- data/lib/devise_invitable/version.rb +3 -0
- data/lib/generators/active_record/devise_invitable_generator.rb +13 -0
- data/lib/generators/active_record/templates/migration.rb +20 -0
- data/lib/generators/devise_invitable/devise_invitable_generator.rb +16 -0
- data/lib/generators/devise_invitable/install_generator.rb +35 -0
- data/lib/generators/devise_invitable/views_generator.rb +10 -0
- data/test/generators_test.rb +45 -0
- data/test/integration/invitation_test.rb +107 -0
- data/test/integration_tests_helper.rb +58 -0
- data/test/mailers/invitation_mail_test.rb +63 -0
- data/test/model_tests_helper.rb +41 -0
- data/test/models/invitable_test.rb +213 -0
- data/test/models_test.rb +32 -0
- data/test/rails_app/app/controllers/admins_controller.rb +6 -0
- data/test/rails_app/app/controllers/application_controller.rb +3 -0
- data/test/rails_app/app/controllers/home_controller.rb +4 -0
- data/test/rails_app/app/controllers/users_controller.rb +12 -0
- data/test/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/rails_app/app/models/octopussy.rb +11 -0
- data/test/rails_app/app/models/user.rb +4 -0
- data/test/rails_app/app/views/home/index.html.erb +0 -0
- data/test/rails_app/app/views/layouts/application.html.erb +16 -0
- data/test/rails_app/app/views/users/invitations/new.html.erb +15 -0
- data/test/rails_app/config.ru +4 -0
- data/test/rails_app/config/application.rb +46 -0
- data/test/rails_app/config/boot.rb +14 -0
- data/test/rails_app/config/database.yml +22 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +26 -0
- data/test/rails_app/config/environments/production.rb +49 -0
- data/test/rails_app/config/environments/test.rb +35 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/devise.rb +174 -0
- data/test/rails_app/config/initializers/inflections.rb +10 -0
- data/test/rails_app/config/initializers/mime_types.rb +5 -0
- data/test/rails_app/config/initializers/secret_token.rb +7 -0
- data/test/rails_app/config/initializers/session_store.rb +8 -0
- data/test/rails_app/config/locales/en.yml +5 -0
- data/test/rails_app/config/routes.rb +4 -0
- data/test/rails_app/script/rails +6 -0
- data/test/routes_test.rb +20 -0
- data/test/test_helper.rb +31 -0
- metadata +297 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
RailsApp::Application.config.secret_token = 'e997edf9d7eba5cf89a76a046fa53f5d66261d22cfcf29e3f538c75ad2d175b106bd5d099f44f6ce34ad3b3162d71cfaa37d2d4f4b38645288331427b4c2a607'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
RailsApp::Application.config.session_store :cookie_store, :key => '_test_app_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rake db:sessions:create")
|
8
|
+
# RailsApp::Application.config.session_store :active_record_store
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/routes_test.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test/test_helper'
|
2
|
+
|
3
|
+
class RoutesTest < ActionController::TestCase
|
4
|
+
|
5
|
+
test 'map new user invitation' do
|
6
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'new'}, {:path => 'users/invitation/new', :method => :get})
|
7
|
+
end
|
8
|
+
|
9
|
+
test 'map create user invitation' do
|
10
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'create'}, {:path => 'users/invitation', :method => :post})
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'map accept user invitation' do
|
14
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'edit'}, 'users/invitation/accept')
|
15
|
+
end
|
16
|
+
|
17
|
+
test 'map update user invitation' do
|
18
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'update'}, {:path => 'users/invitation', :method => :put})
|
19
|
+
end
|
20
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
|
3
|
+
require 'rails_app/config/environment'
|
4
|
+
|
5
|
+
require 'rails/test_help'
|
6
|
+
require 'capybara/rails'
|
7
|
+
|
8
|
+
ActionMailer::Base.delivery_method = :test
|
9
|
+
ActionMailer::Base.perform_deliveries = true
|
10
|
+
ActionMailer::Base.default_url_options[:host] = 'test.com'
|
11
|
+
|
12
|
+
ActiveRecord::Migration.verbose = false
|
13
|
+
ActiveRecord::Base.logger = Logger.new(nil)
|
14
|
+
|
15
|
+
ActiveRecord::Schema.define(:version => 1) do
|
16
|
+
create_table :users do |t|
|
17
|
+
t.database_authenticatable :null => true
|
18
|
+
t.string :username
|
19
|
+
t.confirmable
|
20
|
+
t.invitable
|
21
|
+
t.encryptable
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
ActiveSupport::Deprecation.silenced = true
|
28
|
+
|
29
|
+
class ActionDispatch::IntegrationTest
|
30
|
+
include Capybara
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,297 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dougjohnston-devise_invitable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7712090
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
- rc
|
10
|
+
version: 0.4.rc
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Sergio Cambra
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-17 00:00:00 -08:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 43
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 9
|
31
|
+
- 8
|
32
|
+
version: 0.9.8
|
33
|
+
type: :runtime
|
34
|
+
name: mocha
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 1
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 3
|
47
|
+
- 9
|
48
|
+
version: 0.3.9
|
49
|
+
type: :runtime
|
50
|
+
name: capybara
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 7
|
60
|
+
segments:
|
61
|
+
- 3
|
62
|
+
- 0
|
63
|
+
- 0
|
64
|
+
version: 3.0.0
|
65
|
+
type: :runtime
|
66
|
+
name: rails
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
type: :runtime
|
80
|
+
name: sqlite3-ruby
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
93
|
+
type: :runtime
|
94
|
+
name: devise
|
95
|
+
prerelease: false
|
96
|
+
version_requirements: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 43
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
- 9
|
107
|
+
- 8
|
108
|
+
version: 0.9.8
|
109
|
+
type: :development
|
110
|
+
name: mocha
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 1
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
- 3
|
123
|
+
- 9
|
124
|
+
version: 0.3.9
|
125
|
+
type: :development
|
126
|
+
name: capybara
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: *id007
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ~>
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 7
|
136
|
+
segments:
|
137
|
+
- 3
|
138
|
+
- 0
|
139
|
+
- 0
|
140
|
+
version: 3.0.0
|
141
|
+
type: :development
|
142
|
+
name: rails
|
143
|
+
prerelease: false
|
144
|
+
version_requirements: *id008
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
hash: 3
|
152
|
+
segments:
|
153
|
+
- 0
|
154
|
+
version: "0"
|
155
|
+
type: :development
|
156
|
+
name: sqlite3-ruby
|
157
|
+
prerelease: false
|
158
|
+
version_requirements: *id009
|
159
|
+
description: It adds support for send invitations by email (it requires to be authenticated) and accept the invitation setting the password
|
160
|
+
email: sergio@entrecables.com
|
161
|
+
executables: []
|
162
|
+
|
163
|
+
extensions: []
|
164
|
+
|
165
|
+
extra_rdoc_files:
|
166
|
+
- LICENSE
|
167
|
+
- README.rdoc
|
168
|
+
files:
|
169
|
+
- .document
|
170
|
+
- Gemfile
|
171
|
+
- Gemfile.lock
|
172
|
+
- LICENSE
|
173
|
+
- README.rdoc
|
174
|
+
- Rakefile
|
175
|
+
- app/controllers/devise/invitations_controller.rb
|
176
|
+
- app/views/devise/invitations/edit.html.erb
|
177
|
+
- app/views/devise/invitations/new.html.erb
|
178
|
+
- app/views/devise/mailer/invitation.html.erb
|
179
|
+
- app/views/devise/mailer/invitation_instructions.html.erb
|
180
|
+
- config/locales/en.yml
|
181
|
+
- devise_invitable.gemspec
|
182
|
+
- lib/devise_invitable.rb
|
183
|
+
- lib/devise_invitable/controllers/helpers.rb
|
184
|
+
- lib/devise_invitable/controllers/url_helpers.rb
|
185
|
+
- lib/devise_invitable/mailer.rb
|
186
|
+
- lib/devise_invitable/model.rb
|
187
|
+
- lib/devise_invitable/rails.rb
|
188
|
+
- lib/devise_invitable/routes.rb
|
189
|
+
- lib/devise_invitable/schema.rb
|
190
|
+
- lib/devise_invitable/version.rb
|
191
|
+
- lib/generators/active_record/devise_invitable_generator.rb
|
192
|
+
- lib/generators/active_record/templates/migration.rb
|
193
|
+
- lib/generators/devise_invitable/devise_invitable_generator.rb
|
194
|
+
- lib/generators/devise_invitable/install_generator.rb
|
195
|
+
- lib/generators/devise_invitable/views_generator.rb
|
196
|
+
- test/generators_test.rb
|
197
|
+
- test/integration/invitation_test.rb
|
198
|
+
- test/integration_tests_helper.rb
|
199
|
+
- test/mailers/invitation_mail_test.rb
|
200
|
+
- test/model_tests_helper.rb
|
201
|
+
- test/models/invitable_test.rb
|
202
|
+
- test/models_test.rb
|
203
|
+
- test/rails_app/app/controllers/admins_controller.rb
|
204
|
+
- test/rails_app/app/controllers/application_controller.rb
|
205
|
+
- test/rails_app/app/controllers/home_controller.rb
|
206
|
+
- test/rails_app/app/controllers/users_controller.rb
|
207
|
+
- test/rails_app/app/helpers/application_helper.rb
|
208
|
+
- test/rails_app/app/models/octopussy.rb
|
209
|
+
- test/rails_app/app/models/user.rb
|
210
|
+
- test/rails_app/app/views/home/index.html.erb
|
211
|
+
- test/rails_app/app/views/layouts/application.html.erb
|
212
|
+
- test/rails_app/app/views/users/invitations/new.html.erb
|
213
|
+
- test/rails_app/config.ru
|
214
|
+
- test/rails_app/config/application.rb
|
215
|
+
- test/rails_app/config/boot.rb
|
216
|
+
- test/rails_app/config/database.yml
|
217
|
+
- test/rails_app/config/environment.rb
|
218
|
+
- test/rails_app/config/environments/development.rb
|
219
|
+
- test/rails_app/config/environments/production.rb
|
220
|
+
- test/rails_app/config/environments/test.rb
|
221
|
+
- test/rails_app/config/initializers/backtrace_silencers.rb
|
222
|
+
- test/rails_app/config/initializers/devise.rb
|
223
|
+
- test/rails_app/config/initializers/inflections.rb
|
224
|
+
- test/rails_app/config/initializers/mime_types.rb
|
225
|
+
- test/rails_app/config/initializers/secret_token.rb
|
226
|
+
- test/rails_app/config/initializers/session_store.rb
|
227
|
+
- test/rails_app/config/locales/en.yml
|
228
|
+
- test/rails_app/config/routes.rb
|
229
|
+
- test/rails_app/script/rails
|
230
|
+
- test/routes_test.rb
|
231
|
+
- test/test_helper.rb
|
232
|
+
has_rdoc: true
|
233
|
+
homepage: http://github.com/scambra/devise_invitable
|
234
|
+
licenses: []
|
235
|
+
|
236
|
+
post_install_message:
|
237
|
+
rdoc_options: []
|
238
|
+
|
239
|
+
require_paths:
|
240
|
+
- lib
|
241
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
242
|
+
none: false
|
243
|
+
requirements:
|
244
|
+
- - ">="
|
245
|
+
- !ruby/object:Gem::Version
|
246
|
+
hash: 3
|
247
|
+
segments:
|
248
|
+
- 0
|
249
|
+
version: "0"
|
250
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
251
|
+
none: false
|
252
|
+
requirements:
|
253
|
+
- - ">"
|
254
|
+
- !ruby/object:Gem::Version
|
255
|
+
hash: 25
|
256
|
+
segments:
|
257
|
+
- 1
|
258
|
+
- 3
|
259
|
+
- 1
|
260
|
+
version: 1.3.1
|
261
|
+
requirements: []
|
262
|
+
|
263
|
+
rubyforge_project:
|
264
|
+
rubygems_version: 1.3.7
|
265
|
+
signing_key:
|
266
|
+
specification_version: 3
|
267
|
+
summary: An invitation strategy for devise
|
268
|
+
test_files:
|
269
|
+
- test/generators_test.rb
|
270
|
+
- test/integration/invitation_test.rb
|
271
|
+
- test/integration_tests_helper.rb
|
272
|
+
- test/mailers/invitation_mail_test.rb
|
273
|
+
- test/model_tests_helper.rb
|
274
|
+
- test/models/invitable_test.rb
|
275
|
+
- test/models_test.rb
|
276
|
+
- test/rails_app/app/controllers/admins_controller.rb
|
277
|
+
- test/rails_app/app/controllers/application_controller.rb
|
278
|
+
- test/rails_app/app/controllers/home_controller.rb
|
279
|
+
- test/rails_app/app/controllers/users_controller.rb
|
280
|
+
- test/rails_app/app/helpers/application_helper.rb
|
281
|
+
- test/rails_app/app/models/octopussy.rb
|
282
|
+
- test/rails_app/app/models/user.rb
|
283
|
+
- test/rails_app/config/application.rb
|
284
|
+
- test/rails_app/config/boot.rb
|
285
|
+
- test/rails_app/config/environment.rb
|
286
|
+
- test/rails_app/config/environments/development.rb
|
287
|
+
- test/rails_app/config/environments/production.rb
|
288
|
+
- test/rails_app/config/environments/test.rb
|
289
|
+
- test/rails_app/config/initializers/backtrace_silencers.rb
|
290
|
+
- test/rails_app/config/initializers/devise.rb
|
291
|
+
- test/rails_app/config/initializers/inflections.rb
|
292
|
+
- test/rails_app/config/initializers/mime_types.rb
|
293
|
+
- test/rails_app/config/initializers/secret_token.rb
|
294
|
+
- test/rails_app/config/initializers/session_store.rb
|
295
|
+
- test/rails_app/config/routes.rb
|
296
|
+
- test/routes_test.rb
|
297
|
+
- test/test_helper.rb
|