mtdevise 3.5.5 → 3.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +3 -2
  4. data/Rakefile +13 -11
  5. data/app/assets/config/mtdevise_manifest.js +2 -0
  6. data/app/assets/javascripts/mtdevise/application.js +3 -4
  7. data/app/{constraints → assets}/mtdevise/constraints/subdomain_required.rb +0 -0
  8. data/app/assets/stylesheets/mtdevise/_custom.scss +3 -0
  9. data/app/assets/stylesheets/mtdevise/application.scss +19 -3
  10. data/app/controllers/mtdevise/application_controller.rb +5 -6
  11. data/app/controllers/mtdevise/welcome_controller.rb +1 -1
  12. data/app/jobs/mtdevise/application_job.rb +4 -0
  13. data/app/mailers/mtdevise/application_mailer.rb +6 -0
  14. data/app/models/mtdevise/application_record.rb +5 -0
  15. data/config/initializers/devise/strategies/subdomain.rb +1 -1
  16. data/config/routes.rb +1 -1
  17. data/db/migrate/20150426071228_create_mtdevise_accounts.rb +1 -1
  18. data/db/migrate/20150426115631_add_owner_id_to_mtdevise_accounts.rb +1 -1
  19. data/db/migrate/20150426115910_create_mtdevise_users.rb +1 -1
  20. data/db/migrate/20150426143800_add_devise_to_mtdevise_users.rb +1 -1
  21. data/db/migrate/20150427200506_add_subdomain_to_mtdevise_accounts.rb +1 -1
  22. data/db/migrate/20150428110406_create_mtdevise_members.rb +1 -1
  23. data/db/migrate/20150504181830_add_confirmed_at_to_users.rb +1 -1
  24. data/db/migrate/20150719125100_add_authentication_token_to_mtdevise_users.rb +1 -1
  25. data/db/migrate/20151231043439_add_firstname_to_mtdevise_accounts.rb +1 -1
  26. data/lib/mtdevise.rb +1 -0
  27. data/lib/mtdevise/version.rb +1 -1
  28. data/lib/tasks/mtdevise_tasks.rake +1 -1
  29. metadata +109 -296
  30. data/LICENSE +0 -238
  31. data/app/assets/javascripts/mtdevise/account/dashboard.js +0 -2
  32. data/app/assets/javascripts/mtdevise/account/sessions.js +0 -2
  33. data/app/assets/javascripts/mtdevise/account/users.js +0 -2
  34. data/app/assets/javascripts/mtdevise/accounts.js +0 -2
  35. data/app/assets/javascripts/mtdevise/dashboard.js +0 -2
  36. data/app/assets/javascripts/mtdevise/welcome.js +0 -2
  37. data/app/assets/stylesheets/mtdevise/account/dashboard.css +0 -4
  38. data/app/assets/stylesheets/mtdevise/account/sessions.css +0 -4
  39. data/app/assets/stylesheets/mtdevise/account/users.css +0 -4
  40. data/app/assets/stylesheets/mtdevise/accounts.css +0 -4
  41. data/app/assets/stylesheets/mtdevise/dashboard.css +0 -4
  42. data/app/assets/stylesheets/mtdevise/jumbotron-narrow.css +0 -65
  43. data/app/assets/stylesheets/mtdevise/non-responsive.css +0 -30
  44. data/app/assets/stylesheets/mtdevise/welcome.css +0 -4
  45. data/app/helpers/mtdevise/account/dashboard_helper.rb +0 -4
  46. data/app/helpers/mtdevise/account/sessions_helper.rb +0 -4
  47. data/app/helpers/mtdevise/account/users_helper.rb +0 -4
  48. data/app/helpers/mtdevise/accounts_helper.rb +0 -4
  49. data/app/helpers/mtdevise/dashboard_helper.rb +0 -4
  50. data/app/helpers/mtdevise/welcome_helper.rb +0 -4
  51. data/spec/controllers/mtdevise/accounts_controller_spec.rb +0 -30
  52. data/spec/features/accounts/create_spec.rb +0 -51
  53. data/spec/features/accounts/index_spec.rb +0 -22
  54. data/spec/features/accounts/scoping_spec.rb +0 -24
  55. data/spec/features/accounts/sign_in_spec.rb +0 -21
  56. data/spec/features/accounts/sign_up_spec.rb +0 -104
  57. data/spec/features/root_spec.rb +0 -29
  58. data/spec/features/users/invite_spec.rb +0 -4
  59. data/spec/features/users/sign_in_spec.rb +0 -52
  60. data/spec/features/users/sign_up_spec.rb +0 -21
  61. data/spec/helpers/mtdevise/account/dashboard_helper_spec.rb +0 -17
  62. data/spec/helpers/mtdevise/account/sessions_helper_spec.rb +0 -17
  63. data/spec/helpers/mtdevise/account/users_helper_spec.rb +0 -17
  64. data/spec/helpers/mtdevise/accounts_helper_spec.rb +0 -17
  65. data/spec/helpers/mtdevise/dashboard_helper_spec.rb +0 -17
  66. data/spec/helpers/mtdevise/welcome_helper_spec.rb +0 -17
  67. data/spec/models/mtdevise/account_spec.rb +0 -24
  68. data/spec/models/mtdevise/user_spec.rb +0 -12
  69. data/spec/rails_helper.rb +0 -58
  70. data/spec/spec_helper.rb +0 -75
  71. data/spec/support/authentication_helpers.rb +0 -3
  72. data/spec/support/factories/account_factory.rb +0 -13
  73. data/spec/support/factories/user_factory.rb +0 -8
  74. data/spec/support/feature_helpers.rb +0 -25
  75. data/spec/support/subdomain_helpers.rb +0 -8
  76. data/spec/test_app/README.rdoc +0 -28
  77. data/spec/test_app/Rakefile +0 -4
  78. data/spec/test_app/app/assets/javascripts/application.js +0 -15
  79. data/spec/test_app/app/assets/javascripts/things.js +0 -2
  80. data/spec/test_app/app/assets/stylesheets/application.css +0 -15
  81. data/spec/test_app/app/assets/stylesheets/things.css +0 -4
  82. data/spec/test_app/app/controllers/application_controller.rb +0 -5
  83. data/spec/test_app/app/controllers/things_controller.rb +0 -5
  84. data/spec/test_app/app/helpers/application_helper.rb +0 -2
  85. data/spec/test_app/app/helpers/things_helper.rb +0 -2
  86. data/spec/test_app/app/models/thing.rb +0 -3
  87. data/spec/test_app/app/models/user.rb +0 -3
  88. data/spec/test_app/app/views/layouts/application.html.erb +0 -12
  89. data/spec/test_app/app/views/things/index.html.erb +0 -6
  90. data/spec/test_app/bin/bundle +0 -3
  91. data/spec/test_app/bin/rails +0 -4
  92. data/spec/test_app/bin/rake +0 -4
  93. data/spec/test_app/config.ru +0 -4
  94. data/spec/test_app/config/application.rb +0 -28
  95. data/spec/test_app/config/boot.rb +0 -5
  96. data/spec/test_app/config/database.circle.yml +0 -4
  97. data/spec/test_app/config/database.yml +0 -17
  98. data/spec/test_app/config/environment.rb +0 -5
  99. data/spec/test_app/config/environments/development.rb +0 -39
  100. data/spec/test_app/config/environments/production.rb +0 -84
  101. data/spec/test_app/config/environments/test.rb +0 -41
  102. data/spec/test_app/config/initializers/backtrace_silencers.rb +0 -7
  103. data/spec/test_app/config/initializers/cookies_serializer.rb +0 -2
  104. data/spec/test_app/config/initializers/filter_parameter_logging.rb +0 -3
  105. data/spec/test_app/config/initializers/inflections.rb +0 -16
  106. data/spec/test_app/config/initializers/mime_types.rb +0 -4
  107. data/spec/test_app/config/initializers/session_store.rb +0 -4
  108. data/spec/test_app/config/initializers/wrap_parameters.rb +0 -14
  109. data/spec/test_app/config/locales/en.yml +0 -23
  110. data/spec/test_app/config/routes.rb +0 -6
  111. data/spec/test_app/config/secrets.yml +0 -22
  112. data/spec/test_app/db/migrate/20140428155742_create_things.rb +0 -10
  113. data/spec/test_app/db/schema.rb +0 -68
  114. data/spec/test_app/public/404.html +0 -67
  115. data/spec/test_app/public/422.html +0 -67
  116. data/spec/test_app/public/500.html +0 -66
  117. data/spec/test_app/public/favicon.ico +0 -0
  118. data/spec/test_app/spec/controllers/things_controller_spec.rb +0 -3
  119. data/spec/test_app/spec/helpers/things_helper_spec.rb +0 -14
  120. data/spec/test_app/spec/models/thing_spec.rb +0 -4
  121. data/spec/test_app/spec/views/things/index.html.erb_spec.rb +0 -4
@@ -1,24 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Mtdevise::Account do
4
-
5
- it "can be created with an owner" do
6
- params = {
7
- :name => "Test Account",
8
- :firstname => "Test",
9
- :lastname => "Test",
10
- :username => "test",
11
- :subdomain => "test",
12
- :owner_attributes => {
13
- :email => "user@example.com",
14
- :password => "password",
15
- :password_confirmation => "password"
16
- }
17
- }
18
- account = Mtdevise::Account.create_with_owner(params)
19
- users = account.users
20
- expect(account).to be_persisted
21
- expect(users.first).to eq(account.owner)
22
-
23
- end
24
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Mtdevise::User do
4
-
5
- context "fields" do
6
- end
7
-
8
- context "validations" do
9
- it { is_expected.to validate_presence_of(:email) }
10
- end
11
-
12
- end
data/spec/rails_helper.rb DELETED
@@ -1,58 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV['RAILS_ENV'] ||= 'test'
3
- require File.expand_path('../../config/environment', __FILE__)
4
-
5
- # Prevent database truncation if the environment is production
6
- abort("The Rails environment is running in production mode!") if Rails.env.production?
7
- require 'spec_helper'
8
- require 'rspec/rails'
9
-
10
- # Add additional requires below this line. Rails is not loaded until this point!
11
- # Requires supporting ruby files with custom matchers and macros, etc, in
12
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
13
- # run as spec files by default. This means that files in spec/support that end
14
- # in _spec.rb will both be required and run as specs, causing the specs to be
15
- # run twice. It is recommended that you do not name files matching this glob to
16
- # end with _spec.rb. You can configure this pattern with the --pattern
17
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
18
- #
19
- # The following line is provided for convenience purposes. It has the downside
20
- # of increasing the boot-up time by auto-requiring all files in the support
21
- # directory. Alternatively, in the individual `*_spec.rb` files, manually
22
- # require only the support files necessary.
23
- #
24
- # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
25
- # Checks for pending migration and applies them before tests are run.
26
- # If you are not using ActiveRecord, you can remove this line.
27
- ActiveRecord::Migration.maintain_test_schema!
28
-
29
- RSpec.configure do |config|
30
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
31
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
32
-
33
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
34
- # examples within a transaction, remove the following line or assign false
35
- # instead of true.
36
- config.use_transactional_fixtures = true
37
-
38
- # RSpec Rails can automatically mix in different behaviours to your tests
39
- # based on their file location, for example enabling you to call `get` and
40
- # `post` in specs under `spec/controllers`.
41
- #
42
- # You can disable this behaviour by removing the line below, and instead
43
- # explicitly tag your specs with their type, e.g.:
44
- #
45
- # RSpec.describe UsersController, :type => :controller do
46
- # # ...
47
- # end
48
- #
49
- # The different available types are documented in the features, such as in
50
- # https://relishapp.com/rspec/rspec-rails/docs
51
- config.infer_spec_type_from_file_location!
52
-
53
- # Filter lines from Rails gems in backtraces.
54
- config.filter_rails_from_backtrace!
55
-
56
- # arbitrary gems may also be filtered via:
57
- # config.filter_gems_from_backtrace("gem name")
58
- end
data/spec/spec_helper.rb DELETED
@@ -1,75 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV["RAILS_ENV"] ||= 'test'
3
- ENV["PHC_MTDEVISE_SENDER"] ||= 'no-reply@phcnetworks.net'
4
-
5
- require File.expand_path("../test_app/config/environment", __FILE__)
6
- require 'rspec/rails'
7
- require 'rspec/autorun'
8
- require 'shoulda/matchers'
9
- require 'capybara/rspec'
10
- require "factory_girl"
11
- require "database_cleaner"
12
-
13
- # Requires supporting ruby files with custom matchers and macros, etc,
14
- # in spec/support/ and its subdirectories.
15
- Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
16
-
17
-
18
- # Checks for pending migrations before tests are run.
19
- # If you are not using ActiveRecord, you can remove this line.
20
- ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
21
-
22
- RSpec.configure do |config|
23
- config.include FactoryGirl::Syntax::Methods
24
- config.warnings = false
25
- # ## Mock Framework
26
- #
27
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
28
- #
29
- # config.mock_with :mocha
30
- # config.mock_with :flexmock
31
- # config.mock_with :rr
32
-
33
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
34
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
35
-
36
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
37
- # examples within a transaction, remove the following line or assign false
38
- # instead of true.
39
- # config.use_transactional_fixtures = true
40
-
41
- # If true, the base class of anonymous controllers will be inferred
42
- # automatically. This will be the default behavior in future versions of
43
- # rspec-rails.
44
- config.infer_base_class_for_anonymous_controllers = false
45
- config.infer_spec_type_from_file_location!
46
-
47
- # Run specs in random order to surface order dependencies. If you find an
48
- # order dependency and want to debug it, you can fix the order by providing
49
- # the seed, which is printed after each run.
50
- # --seed 1234
51
- config.order = "random"
52
-
53
- config.before(:all) do
54
- DatabaseCleaner.strategy = :truncation,
55
- {:pre_count => true, :reset_ids => true}
56
- DatabaseCleaner.clean_with(:truncation)
57
- end
58
- config.before(:each) do
59
- DatabaseCleaner.start
60
- end
61
- config.after(:each) do
62
- DatabaseCleaner.clean
63
- end
64
-
65
- end
66
-
67
- Capybara.app_host = "http://example.com"
68
-
69
- # Fix to load shoulda matches
70
- Shoulda::Matchers.configure do |config|
71
- config.integrate do |with|
72
- with.test_framework :rspec
73
- with.library :rails
74
- end
75
- end
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include Devise::TestHelpers, type: :controller
3
- end
@@ -1,13 +0,0 @@
1
- FactoryGirl.define do
2
- factory :account, :class => Mtdevise::Account do
3
- sequence(:name) { |n| "Test Account ##{n}" }
4
- sequence(:firstname) { |n| "Test#{n}" }
5
- sequence(:lastname) { |n| "Test#{n}" }
6
- sequence(:username) { |n| "test#{n}" }
7
- sequence(:subdomain) { |n| "test#{n}" }
8
- association :owner, :factory => :user
9
- after(:create) do |account|
10
- account.users << account.owner
11
- end
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- FactoryGirl.define do
2
- factory :user, :class => Mtdevise::User do
3
- sequence(:email) { |n| "test#{n}@example.com" }
4
- password "password"
5
- password_confirmation { |u| u.password }
6
- confirmed_at {Time.now}
7
- end
8
- end
@@ -1,25 +0,0 @@
1
- module Features
2
-
3
- module SessionHelpers
4
- def sign_in(user = nil, pwd = nil)
5
- default_pwd = 'Passw0rd'
6
- visitor = user || create( :user, email: 'orbanbotond@gmail.com', password: default_pwd, password_confirmation: default_pwd)
7
- password = pwd || default_pwd
8
- visit mtdevise.new_user_session_path
9
- fill_in "user_email", with: visitor.email
10
- fill_in 'user_password', with: password
11
- click_on 'Sign-In'
12
- end
13
-
14
- def logout
15
- click_on 'settings_dropdown'
16
- sleep(2)
17
- click_on 'Logout'
18
- end
19
-
20
- end
21
- end
22
-
23
- RSpec.configure do |config|
24
- config.include Features::SessionHelpers, type: :feature
25
- end
@@ -1,8 +0,0 @@
1
- module SubdomainHelpers
2
- def within_account_subdomain
3
- let(:subdomain_url) { "http://#{account.subdomain}.example.com" }
4
- before { Capybara.default_host = subdomain_url }
5
- after { Capybara.default_host = "http://example.com" }
6
- yield
7
- end
8
- end
@@ -1,28 +0,0 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
@@ -1,4 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
- require File.expand_path('../config/application', __FILE__)
4
- Rails.application.load_tasks
@@ -1,15 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
14
- //= require jquery
15
- //= require jquery_ujs
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,5 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
- end
@@ -1,5 +0,0 @@
1
- class ThingsController < ApplicationController
2
- def index
3
- @things = Thing.scoped_to(current_account)
4
- end
5
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module ThingsHelper
2
- end
@@ -1,3 +0,0 @@
1
- class Thing < ActiveRecord::Base
2
- extend Mtdevise::ScopedTo
3
- end
@@ -1,3 +0,0 @@
1
- class User < ActiveRecord::Base
2
- include Mtdevise::UserStorage
3
- end
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
- <%= yield %>
11
- </body>
12
- </html>
@@ -1,6 +0,0 @@
1
- <h1>Things</h1>
2
- <ul>
3
- <% @things.each do |thing| %>”
4
- <li><%= thing.name %></li>
5
- <% end %>
6
- </ul>
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,28 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- # Pick the frameworks you want:
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
- require "action_mailer/railtie"
7
- require "action_view/railtie"
8
- require "sprockets/railtie"
9
- # require "rails/test_unit/railtie"
10
-
11
- Bundler.require(*Rails.groups)
12
- require "mtdevise"
13
-
14
- module Dummy
15
- class Application < Rails::Application
16
- # Settings in config/environments/* take precedence over those specified here.
17
- # Application configuration should go into files in config/initializers
18
- # -- all .rb files in that directory are automatically loaded.
19
-
20
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
- # config.time_zone = 'Central Time (US & Canada)'
23
-
24
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
- # config.i18n.default_locale = :de
27
- end
28
- end
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,4 +0,0 @@
1
- test:
2
- host: localhost
3
- database: circle_ruby_test
4
- adapter: postgresql