devise_invitable 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/app/controllers/devise/invitations_controller.rb~ +48 -0
  2. data/config/locales/en.yml +1 -1
  3. data/lib/devise_invitable/model.rb +5 -0
  4. data/lib/devise_invitable/model.rb~ +129 -0
  5. data/lib/devise_invitable/version.rb +3 -0
  6. metadata +42 -104
  7. data/.document +0 -5
  8. data/.gitignore +0 -22
  9. data/Gemfile +0 -3
  10. data/Gemfile.lock +0 -117
  11. data/Rakefile +0 -55
  12. data/VERSION +0 -1
  13. data/devise_invitable.gemspec +0 -146
  14. data/test/generators_test.rb +0 -45
  15. data/test/integration/invitable_test.rb +0 -109
  16. data/test/integration_tests_helper.rb +0 -58
  17. data/test/mailers/invitation_test.rb +0 -62
  18. data/test/model_tests_helper.rb +0 -41
  19. data/test/models/invitable_test.rb +0 -188
  20. data/test/models_test.rb +0 -31
  21. data/test/rails_app/app/controllers/admins_controller.rb +0 -6
  22. data/test/rails_app/app/controllers/application_controller.rb +0 -3
  23. data/test/rails_app/app/controllers/home_controller.rb +0 -4
  24. data/test/rails_app/app/controllers/users_controller.rb +0 -12
  25. data/test/rails_app/app/helpers/application_helper.rb +0 -2
  26. data/test/rails_app/app/models/octopussy.rb +0 -11
  27. data/test/rails_app/app/models/user.rb +0 -4
  28. data/test/rails_app/app/views/home/index.html.erb +0 -0
  29. data/test/rails_app/app/views/layouts/application.html.erb +0 -15
  30. data/test/rails_app/app/views/users/invitations/new.html.erb +0 -15
  31. data/test/rails_app/config.ru +0 -4
  32. data/test/rails_app/config/application.rb +0 -46
  33. data/test/rails_app/config/boot.rb +0 -13
  34. data/test/rails_app/config/database.yml +0 -22
  35. data/test/rails_app/config/environment.rb +0 -5
  36. data/test/rails_app/config/environments/development.rb +0 -26
  37. data/test/rails_app/config/environments/production.rb +0 -49
  38. data/test/rails_app/config/environments/test.rb +0 -35
  39. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  40. data/test/rails_app/config/initializers/devise.rb +0 -144
  41. data/test/rails_app/config/initializers/inflections.rb +0 -10
  42. data/test/rails_app/config/initializers/mime_types.rb +0 -5
  43. data/test/rails_app/config/initializers/secret_token.rb +0 -7
  44. data/test/rails_app/config/initializers/session_store.rb +0 -8
  45. data/test/rails_app/config/locales/en.yml +0 -5
  46. data/test/rails_app/config/routes.rb +0 -4
  47. data/test/rails_app/script/rails +0 -6
  48. data/test/routes_test.rb +0 -20
  49. data/test/test_helper.rb +0 -30
@@ -1,26 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.rb
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the webserver when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_view.debug_rjs = true
15
- config.action_controller.perform_caching = false
16
-
17
- # Don't care if the mailer can't send
18
- config.action_mailer.raise_delivery_errors = false
19
-
20
- # Print deprecation notices to the Rails logger
21
- config.active_support.deprecation = :log
22
-
23
- # Only use best-standards-support built into browsers
24
- config.action_dispatch.best_standards_support = :builtin
25
- end
26
-
@@ -1,49 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.rb
3
-
4
- # The production environment is meant for finished, "live" apps.
5
- # Code is not reloaded between requests
6
- config.cache_classes = true
7
-
8
- # Full error reports are disabled and caching is turned on
9
- config.consider_all_requests_local = false
10
- config.action_controller.perform_caching = true
11
-
12
- # Specifies the header that your server uses for sending files
13
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
-
15
- # For nginx:
16
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
-
18
- # If you have no front-end server that supports something like X-Sendfile,
19
- # just comment this out and Rails will serve the files
20
-
21
- # See everything in the log (default is :info)
22
- # config.log_level = :debug
23
-
24
- # Use a different logger for distributed setups
25
- # config.logger = SyslogLogger.new
26
-
27
- # Use a different cache store in production
28
- # config.cache_store = :mem_cache_store
29
-
30
- # Disable Rails's static asset server
31
- # In production, Apache or nginx will already do this
32
- config.serve_static_assets = false
33
-
34
- # Enable serving of images, stylesheets, and javascripts from an asset server
35
- # config.action_controller.asset_host = "http://assets.example.com"
36
-
37
- # Disable delivery errors, bad email addresses will be ignored
38
- # config.action_mailer.raise_delivery_errors = false
39
-
40
- # Enable threaded mode
41
- # config.threadsafe!
42
-
43
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
- # the I18n.default_locale when a translation can not be found)
45
- config.i18n.fallbacks = true
46
-
47
- # Send deprecation notices to registered listeners
48
- config.active_support.deprecation = :notify
49
- end
@@ -1,35 +0,0 @@
1
- RailsApp::Application.configure do
2
- # Settings specified here will take precedence over those in config/environment.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
12
-
13
- # Show full error reports and disable caching
14
- config.consider_all_requests_local = true
15
- config.action_controller.perform_caching = false
16
-
17
- # Raise exceptions instead of rendering exception templates
18
- config.action_dispatch.show_exceptions = false
19
-
20
- # Disable request forgery protection in test environment
21
- config.action_controller.allow_forgery_protection = false
22
-
23
- # Tell Action Mailer not to deliver emails to the real world.
24
- # The :test delivery method accumulates sent emails in the
25
- # ActionMailer::Base.deliveries array.
26
- config.action_mailer.delivery_method = :test
27
-
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
32
-
33
- # Print deprecation notices to the stderr
34
- config.active_support.deprecation = :stderr
35
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- Rails.backtrace_cleaner.remove_silencers!
@@ -1,144 +0,0 @@
1
- # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
- # four configuration values can also be set straight in your models.
3
- Devise.setup do |config|
4
- # ==> Mailer Configuration
5
- # Configure the e-mail address which will be shown in DeviseMailer.
6
- config.mailer_sender = "please-change-me@config-initializers-devise.com"
7
-
8
- # Configure the class responsible to send e-mails.
9
- # config.mailer = "Devise::Mailer"
10
-
11
- # ==> ORM configuration
12
- # Load and configure the ORM. Supports :active_record (default) and
13
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
14
- # available as additional gems.
15
- require 'devise/orm/active_record'
16
-
17
- # ==> Configuration for any authentication mechanism
18
- # Configure which keys are used when authenticating an user. By default is
19
- # just :email. You can configure it to use [:username, :subdomain], so for
20
- # authenticating an user, both parameters are required. Remember that those
21
- # parameters are used only when authenticating and not when retrieving from
22
- # session. If you need permissions, you should implement that in a before filter.
23
- # config.authentication_keys = [ :email ]
24
-
25
- # Tell if authentication through request.params is enabled. True by default.
26
- # config.params_authenticatable = true
27
-
28
- # Tell if authentication through HTTP Basic Auth is enabled. True by default.
29
- # config.http_authenticatable = true
30
-
31
- # Set this to true to use Basic Auth for AJAX requests. True by default.
32
- # config.http_authenticatable_on_xhr = true
33
-
34
- # The realm used in Http Basic Authentication
35
- # config.http_authentication_realm = "Application"
36
-
37
- # ==> Configuration for :database_authenticatable
38
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
39
- # using other encryptors, it sets how many times you want the password re-encrypted.
40
- config.stretches = 10
41
-
42
- # Define which will be the encryption algorithm. Devise also supports encryptors
43
- # from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
44
- # you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
45
- # (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
46
- config.encryptor = :sha1
47
-
48
- # Setup a pepper to generate the encrypted password.
49
- config.pepper = "c9ed39f2a5faea59e2f9634cd5466703ead30a1fe25ab08cad00fe4d41d23467401fd731eaca1b1326d97b3065217daa81a18368ecc435978e6e868442b753ac"
50
-
51
- # ==> Configuration for :invitable
52
- # Time interval where the invitation token is valid.
53
- # If invite_for is 0 or nil, the invitation will never expire.
54
- # Default: 0
55
- # config.invite_for = 2.weeks
56
-
57
- # ==> Configuration for :confirmable
58
- # The time you want to give your user to confirm his account. During this time
59
- # he will be able to access your application without confirming. Default is nil.
60
- # When confirm_within is zero, the user won't be able to sign in without confirming.
61
- # You can use this to let your user access some features of your application
62
- # without confirming the account, but blocking it after a certain period
63
- # (ie 2 days).
64
- # config.confirm_within = 2.days
65
-
66
- # ==> Configuration for :rememberable
67
- # The time the user will be remembered without asking for credentials again.
68
- # config.remember_for = 2.weeks
69
-
70
- # If true, a valid remember token can be re-used between multiple browsers.
71
- # config.remember_across_browsers = true
72
-
73
- # If true, extends the user's remember period when remembered via cookie.
74
- # config.extend_remember_period = false
75
-
76
- # ==> Configuration for :validatable
77
- # Range for password length
78
- # config.password_length = 6..20
79
-
80
- # Regex to use to validate the email address
81
- # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
82
-
83
- # ==> Configuration for :timeoutable
84
- # The time you want to timeout the user session without activity. After this
85
- # time the user will be asked for credentials again.
86
- # config.timeout_in = 10.minutes
87
-
88
- # ==> Configuration for :lockable
89
- # Defines which strategy will be used to lock an account.
90
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
91
- # :none = No lock strategy. You should handle locking by yourself.
92
- # config.lock_strategy = :failed_attempts
93
-
94
- # Defines which strategy will be used to unlock an account.
95
- # :email = Sends an unlock link to the user email
96
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
97
- # :both = Enables both strategies
98
- # :none = No unlock strategy. You should handle unlocking by yourself.
99
- # config.unlock_strategy = :both
100
-
101
- # Number of authentication tries before locking an account if lock_strategy
102
- # is failed attempts.
103
- # config.maximum_attempts = 20
104
-
105
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
106
- # config.unlock_in = 1.hour
107
-
108
- # ==> Configuration for :token_authenticatable
109
- # Defines name of the authentication token params key
110
- # config.token_authentication_key = :auth_token
111
-
112
- # ==> Scopes configuration
113
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
114
- # "users/sessions/new". It's turned off by default because it's slower if you
115
- # are using only default views.
116
- config.scoped_views = true
117
-
118
- # Configure sign_out behavior.
119
- # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
120
- # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
121
- # config.sign_out_all_scopes = false
122
-
123
- # ==> Navigation configuration
124
- # Lists the formats that should be treated as navigational. Formats like
125
- # :html, should redirect to the sign in page when the user does not have
126
- # access, but formats like :xml or :json, should return 401.
127
- # If you have any extra navigational formats, like :iphone or :mobile, you
128
- # should add them to the navigational formats lists. Default is [:html]
129
- # config.navigational_formats = [:html, :iphone]
130
-
131
- # ==> Warden configuration
132
- # If you want to use other strategies, that are not (yet) supported by Devise,
133
- # you can configure them inside the config.warden block. The example below
134
- # allows you to setup OAuth, using http://github.com/roman/warden_oauth
135
- #
136
- # config.warden do |manager|
137
- # manager.oauth(:twitter) do |twitter|
138
- # twitter.consumer_secret = <YOUR CONSUMER SECRET>
139
- # twitter.consumer_key = <YOUR CONSUMER KEY>
140
- # twitter.options :site => 'http://twitter.com'
141
- # end
142
- # manager.default_strategies(:scope => :user).unshift :twitter_oauth
143
- # end
144
- end
@@ -1,10 +0,0 @@
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
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
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'
@@ -1,8 +0,0 @@
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
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,4 +0,0 @@
1
- RailsApp::Application.routes.draw do
2
- devise_for :users
3
- root :to => 'home#index'
4
- end
@@ -1,6 +0,0 @@
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'
@@ -1,20 +0,0 @@
1
- require 'test/test_helper'
2
-
3
- class MapRoutingTest < 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
@@ -1,30 +0,0 @@
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 'bundler'
7
- Bundler.setup(:default, :development)
8
- require 'capybara/rails'
9
-
10
- ActionMailer::Base.delivery_method = :test
11
- ActionMailer::Base.perform_deliveries = true
12
- ActionMailer::Base.default_url_options[:host] = 'test.com'
13
-
14
- ActiveRecord::Migration.verbose = false
15
- ActiveRecord::Base.logger = Logger.new(nil)
16
-
17
- ActiveRecord::Schema.define(:version => 1) do
18
- create_table :users do |t|
19
- t.database_authenticatable :null => true
20
- t.string :username
21
- t.confirmable
22
- t.invitable
23
-
24
- t.timestamps
25
- end
26
- end
27
-
28
- class ActionDispatch::IntegrationTest
29
- include Capybara
30
- end