mtdevise 3.5.5 → 3.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/README.md +3 -2
- data/Rakefile +13 -11
- data/app/assets/config/mtdevise_manifest.js +2 -0
- data/app/assets/javascripts/mtdevise/application.js +3 -4
- data/app/{constraints → assets}/mtdevise/constraints/subdomain_required.rb +0 -0
- data/app/assets/stylesheets/mtdevise/_custom.scss +3 -0
- data/app/assets/stylesheets/mtdevise/application.scss +19 -3
- data/app/controllers/mtdevise/application_controller.rb +5 -6
- data/app/controllers/mtdevise/welcome_controller.rb +1 -1
- data/app/jobs/mtdevise/application_job.rb +4 -0
- data/app/mailers/mtdevise/application_mailer.rb +6 -0
- data/app/models/mtdevise/application_record.rb +5 -0
- data/config/initializers/devise/strategies/subdomain.rb +1 -1
- data/config/routes.rb +1 -1
- data/db/migrate/20150426071228_create_mtdevise_accounts.rb +1 -1
- data/db/migrate/20150426115631_add_owner_id_to_mtdevise_accounts.rb +1 -1
- data/db/migrate/20150426115910_create_mtdevise_users.rb +1 -1
- data/db/migrate/20150426143800_add_devise_to_mtdevise_users.rb +1 -1
- data/db/migrate/20150427200506_add_subdomain_to_mtdevise_accounts.rb +1 -1
- data/db/migrate/20150428110406_create_mtdevise_members.rb +1 -1
- data/db/migrate/20150504181830_add_confirmed_at_to_users.rb +1 -1
- data/db/migrate/20150719125100_add_authentication_token_to_mtdevise_users.rb +1 -1
- data/db/migrate/20151231043439_add_firstname_to_mtdevise_accounts.rb +1 -1
- data/lib/mtdevise.rb +1 -0
- data/lib/mtdevise/version.rb +1 -1
- data/lib/tasks/mtdevise_tasks.rake +1 -1
- metadata +109 -296
- data/LICENSE +0 -238
- data/app/assets/javascripts/mtdevise/account/dashboard.js +0 -2
- data/app/assets/javascripts/mtdevise/account/sessions.js +0 -2
- data/app/assets/javascripts/mtdevise/account/users.js +0 -2
- data/app/assets/javascripts/mtdevise/accounts.js +0 -2
- data/app/assets/javascripts/mtdevise/dashboard.js +0 -2
- data/app/assets/javascripts/mtdevise/welcome.js +0 -2
- data/app/assets/stylesheets/mtdevise/account/dashboard.css +0 -4
- data/app/assets/stylesheets/mtdevise/account/sessions.css +0 -4
- data/app/assets/stylesheets/mtdevise/account/users.css +0 -4
- data/app/assets/stylesheets/mtdevise/accounts.css +0 -4
- data/app/assets/stylesheets/mtdevise/dashboard.css +0 -4
- data/app/assets/stylesheets/mtdevise/jumbotron-narrow.css +0 -65
- data/app/assets/stylesheets/mtdevise/non-responsive.css +0 -30
- data/app/assets/stylesheets/mtdevise/welcome.css +0 -4
- data/app/helpers/mtdevise/account/dashboard_helper.rb +0 -4
- data/app/helpers/mtdevise/account/sessions_helper.rb +0 -4
- data/app/helpers/mtdevise/account/users_helper.rb +0 -4
- data/app/helpers/mtdevise/accounts_helper.rb +0 -4
- data/app/helpers/mtdevise/dashboard_helper.rb +0 -4
- data/app/helpers/mtdevise/welcome_helper.rb +0 -4
- data/spec/controllers/mtdevise/accounts_controller_spec.rb +0 -30
- data/spec/features/accounts/create_spec.rb +0 -51
- data/spec/features/accounts/index_spec.rb +0 -22
- data/spec/features/accounts/scoping_spec.rb +0 -24
- data/spec/features/accounts/sign_in_spec.rb +0 -21
- data/spec/features/accounts/sign_up_spec.rb +0 -104
- data/spec/features/root_spec.rb +0 -29
- data/spec/features/users/invite_spec.rb +0 -4
- data/spec/features/users/sign_in_spec.rb +0 -52
- data/spec/features/users/sign_up_spec.rb +0 -21
- data/spec/helpers/mtdevise/account/dashboard_helper_spec.rb +0 -17
- data/spec/helpers/mtdevise/account/sessions_helper_spec.rb +0 -17
- data/spec/helpers/mtdevise/account/users_helper_spec.rb +0 -17
- data/spec/helpers/mtdevise/accounts_helper_spec.rb +0 -17
- data/spec/helpers/mtdevise/dashboard_helper_spec.rb +0 -17
- data/spec/helpers/mtdevise/welcome_helper_spec.rb +0 -17
- data/spec/models/mtdevise/account_spec.rb +0 -24
- data/spec/models/mtdevise/user_spec.rb +0 -12
- data/spec/rails_helper.rb +0 -58
- data/spec/spec_helper.rb +0 -75
- data/spec/support/authentication_helpers.rb +0 -3
- data/spec/support/factories/account_factory.rb +0 -13
- data/spec/support/factories/user_factory.rb +0 -8
- data/spec/support/feature_helpers.rb +0 -25
- data/spec/support/subdomain_helpers.rb +0 -8
- data/spec/test_app/README.rdoc +0 -28
- data/spec/test_app/Rakefile +0 -4
- data/spec/test_app/app/assets/javascripts/application.js +0 -15
- data/spec/test_app/app/assets/javascripts/things.js +0 -2
- data/spec/test_app/app/assets/stylesheets/application.css +0 -15
- data/spec/test_app/app/assets/stylesheets/things.css +0 -4
- data/spec/test_app/app/controllers/application_controller.rb +0 -5
- data/spec/test_app/app/controllers/things_controller.rb +0 -5
- data/spec/test_app/app/helpers/application_helper.rb +0 -2
- data/spec/test_app/app/helpers/things_helper.rb +0 -2
- data/spec/test_app/app/models/thing.rb +0 -3
- data/spec/test_app/app/models/user.rb +0 -3
- data/spec/test_app/app/views/layouts/application.html.erb +0 -12
- data/spec/test_app/app/views/things/index.html.erb +0 -6
- data/spec/test_app/bin/bundle +0 -3
- data/spec/test_app/bin/rails +0 -4
- data/spec/test_app/bin/rake +0 -4
- data/spec/test_app/config.ru +0 -4
- data/spec/test_app/config/application.rb +0 -28
- data/spec/test_app/config/boot.rb +0 -5
- data/spec/test_app/config/database.circle.yml +0 -4
- data/spec/test_app/config/database.yml +0 -17
- data/spec/test_app/config/environment.rb +0 -5
- data/spec/test_app/config/environments/development.rb +0 -39
- data/spec/test_app/config/environments/production.rb +0 -84
- data/spec/test_app/config/environments/test.rb +0 -41
- data/spec/test_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/test_app/config/initializers/cookies_serializer.rb +0 -2
- data/spec/test_app/config/initializers/filter_parameter_logging.rb +0 -3
- data/spec/test_app/config/initializers/inflections.rb +0 -16
- data/spec/test_app/config/initializers/mime_types.rb +0 -4
- data/spec/test_app/config/initializers/session_store.rb +0 -4
- data/spec/test_app/config/initializers/wrap_parameters.rb +0 -14
- data/spec/test_app/config/locales/en.yml +0 -23
- data/spec/test_app/config/routes.rb +0 -6
- data/spec/test_app/config/secrets.yml +0 -22
- data/spec/test_app/db/migrate/20140428155742_create_things.rb +0 -10
- data/spec/test_app/db/schema.rb +0 -68
- data/spec/test_app/public/404.html +0 -67
- data/spec/test_app/public/422.html +0 -67
- data/spec/test_app/public/500.html +0 -66
- data/spec/test_app/public/favicon.ico +0 -0
- data/spec/test_app/spec/controllers/things_controller_spec.rb +0 -3
- data/spec/test_app/spec/helpers/things_helper_spec.rb +0 -14
- data/spec/test_app/spec/models/thing_spec.rb +0 -4
- 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
|
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,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,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
|
data/spec/test_app/README.rdoc
DELETED
@@ -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>.
|
data/spec/test_app/Rakefile
DELETED
@@ -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,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,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>
|
data/spec/test_app/bin/bundle
DELETED
data/spec/test_app/bin/rails
DELETED
data/spec/test_app/bin/rake
DELETED
data/spec/test_app/config.ru
DELETED
@@ -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
|