active_record_migration_ui 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +78 -1
- data/Rakefile +14 -20
- data/app/views/active_record_migration_ui/migrations/index.html.erb +1 -0
- data/app/views/layouts/active_record_migration_ui/application.html.erb +9 -10
- data/lib/active_record_migration_ui/logger.rb +2 -1
- data/lib/active_record_migration_ui/middleware.rb +2 -0
- data/lib/active_record_migration_ui/version.rb +1 -1
- data/public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js +2 -0
- data/public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js.gz +0 -0
- data/public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js.map +1 -0
- data/public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js.map.gz +0 -0
- data/public/ar-migration-ui-packs/manifest.json +4 -4
- data/public/ar-migration-ui-packs/manifest.json.gz +0 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/homes_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/javascript/packs/application.js +18 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/homes/index.html.erb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +12 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/babel.config.js +72 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/bin/webpack +19 -0
- data/spec/dummy/bin/webpack-dev-server +19 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +18 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/credentials.yml.enc +1 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +45 -0
- data/spec/dummy/config/environments/production.rb +76 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +34 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/webpack/development.js +5 -0
- data/spec/dummy/config/webpack/environment.js +3 -0
- data/spec/dummy/config/webpack/production.js +5 -0
- data/spec/dummy/config/webpack/test.js +5 -0
- data/spec/dummy/config/webpacker.yml +95 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +15 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +6 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/postcss.config.js +12 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2019-06-20-14-15-00.431.html +9 -0
- data/spec/dummy/tmp/capybara/screenshot_2019-06-20-14-15-00.431.png +0 -0
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/features/with_pending_migration_scripts_spec.rb +24 -0
- data/spec/features/without_pending_migration_scripts_spec.rb +13 -0
- data/spec/rails_helper.rb +67 -0
- data/spec/spec_helper.rb +97 -0
- data/spec/support/be_the_active_record_migration_ui_gem_matcher.rb +23 -0
- data/spec/support/be_the_dummy_app_matcher.rb +18 -0
- data/spec/support/browser_log.rb +18 -0
- data/spec/support/capybara.rb +76 -0
- data/spec/support/capybara_screenshot.rb +4 -0
- data/spec/support/shared_steps.rb +20 -0
- metadata +263 -7
- data/public/ar-migration-ui-packs/js/application-08f2d654f4fdbacf82fd.js +0 -2
- data/public/ar-migration-ui-packs/js/application-08f2d654f4fdbacf82fd.js.gz +0 -0
- data/public/ar-migration-ui-packs/js/application-08f2d654f4fdbacf82fd.js.map +0 -1
- data/public/ar-migration-ui-packs/js/application-08f2d654f4fdbacf82fd.js.map.gz +0 -0
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<html class="h-100"><head>
|
2
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
3
|
+
<title>ActiveRecord Migration Ui</title>
|
4
|
+
|
5
|
+
<meta name="action-cable-url" content="/cable">
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="/ar-migration-ui-packs/css/application-3b1d1981.css"><script src="/ar-migration-ui-packs/js/application-f6e32cefa9de438ce066.js"></script></head>
|
8
|
+
<body class="h-100">
|
9
|
+
<div id="app" class="h-100"><div class="container h-100"><div class="d-flex flex-column h-100"><div class="d-flex flex-row justify-content-center mt-5"><h1>ActiveRecord Migration UI</h1></div><div class="d-flex flex-row justify-content-center"><p class="lead">You have pending migration scripts!</p></div><div class="d-flex flex-row justify-content-center align-items-center h-100 overflow-auto"><div class="d-flex flex-column w-100"><div class="d-flex flex-row flex-fill migrations-container"><ul class="flex-fill list-group"><li href="#" class="list-group-item"><h5 class="mb-0 list-group-item-heading"><div class="badge-container text-center"><span class="migration-status badge badge-warning">pending</span></div><span class="ml-5 migration-version">20190620141454</span><span class="ml-5 migration-name">A dummy script</span></h5><div class="collapse"><div class="mb-0"><div class="migration-log-container overflow-auto my-2 px-3"></div></div></div></li></ul></div><div class="d-flex flex-row justify-content-end"><button type="button" class="btn btn-primary">Migrate now!</button></div></div></div></div></div></div></body></html>
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
4781e109a55b4d8ea391787e37d9909381c39a690d5ddaf2678a6156dce9b54b74726d0bcfcfcfda0c0837a6ba6fa119b82d43249767c257e52ef5597396ab5b
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
require 'rails/generators'
|
3
|
+
require 'rails/generators/active_record/migration/migration_generator'
|
4
|
+
|
5
|
+
feature 'With pending migration scripts' do
|
6
|
+
scenario 'Have one pending migration script, check the migration list' do
|
7
|
+
given_a_new_migration_script_exists
|
8
|
+
when_i_access_the_app
|
9
|
+
|
10
|
+
expect(page).to be_the_active_record_migration_ui_gem
|
11
|
+
expect(page).to have_css('ul.list-group li.list-group-item', count: 1)
|
12
|
+
within('ul.list-group li.list-group-item') do
|
13
|
+
expect(page).to have_css('span.migration-status', text: 'pending')
|
14
|
+
expect(page).to have_css('span.migration-name', text: 'A dummy script')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def given_a_new_migration_script_exists
|
19
|
+
given_the_db_migrate_folder_has_been_reseted
|
20
|
+
|
21
|
+
Rails.application.config.paths['db/migrate'] = the_db_migrate_folder
|
22
|
+
ActiveRecord::Generators::MigrationGenerator.start ['a_dummy_script']
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
feature 'Without pending migration scripts' do
|
4
|
+
scenario "Checks the ActiveRecord Migration UI gem doesn't show up" do
|
5
|
+
given_no_migration_script_exist
|
6
|
+
when_i_access_the_app
|
7
|
+
then_i_should_see_the_dummy_app
|
8
|
+
end
|
9
|
+
|
10
|
+
def then_i_should_see_the_dummy_app
|
11
|
+
expect(page).to be_the_dummy_app
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
require 'spec_helper'
|
3
|
+
ENV['RAILS_ENV'] = 'test'
|
4
|
+
DUMMY_APP_ROOT_FOLDER = File.join(Dir.pwd, 'spec', 'dummy')
|
5
|
+
require File.join(DUMMY_APP_ROOT_FOLDER, 'config', 'environment.rb')
|
6
|
+
|
7
|
+
ActiveRecord::Migrator.migrations_paths = [
|
8
|
+
File.join(DUMMY_APP_ROOT_FOLDER, 'db', 'migrate')
|
9
|
+
]
|
10
|
+
|
11
|
+
# Prevent database truncation if the environment is production
|
12
|
+
if Rails.env.production?
|
13
|
+
abort('The Rails environment is running in production mode!')
|
14
|
+
end
|
15
|
+
require 'rspec/rails'
|
16
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
17
|
+
require 'capybara/rails'
|
18
|
+
require 'capybara/rspec'
|
19
|
+
require 'capybara-screenshot/rspec'
|
20
|
+
|
21
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
22
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
23
|
+
# run as spec files by default. This means that files in spec/support that end
|
24
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
25
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
26
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
27
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
28
|
+
#
|
29
|
+
# The following line is provided for convenience purposes. It has the downside
|
30
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
31
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
32
|
+
# require only the support files necessary.
|
33
|
+
#
|
34
|
+
Dir[File.join(Dir.pwd, 'spec', 'support', '**', '*.rb')].each { |f| require f }
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.include BeTheActiveRecordMigrationUiGem, type: :feature
|
38
|
+
config.include BeTheDummyApp, type: :feature
|
39
|
+
|
40
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
41
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
42
|
+
|
43
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
44
|
+
# examples within a transaction, remove the following line or assign false
|
45
|
+
# instead of true.
|
46
|
+
config.use_transactional_fixtures = true
|
47
|
+
|
48
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
49
|
+
# based on their file location, for example enabling you to call `get` and
|
50
|
+
# `post` in specs under `spec/controllers`.
|
51
|
+
#
|
52
|
+
# You can disable this behaviour by removing the line below, and instead
|
53
|
+
# explicitly tag your specs with their type, e.g.:
|
54
|
+
#
|
55
|
+
# RSpec.describe UsersController, :type => :controller do
|
56
|
+
# # ...
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# The different available types are documented in the features, such as in
|
60
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
61
|
+
config.infer_spec_type_from_file_location!
|
62
|
+
|
63
|
+
# Filter lines from Rails gems in backtraces.
|
64
|
+
config.filter_rails_from_backtrace!
|
65
|
+
# arbitrary gems may also be filtered via:
|
66
|
+
# config.filter_gems_from_backtrace("gem name")
|
67
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# This file was generated by the `rails generate rspec:install` command.
|
2
|
+
# Conventionally, all specs live under a `spec` directory, which RSpec adds to
|
3
|
+
# the `$LOAD_PATH`.
|
4
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
5
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
6
|
+
# files.
|
7
|
+
#
|
8
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
9
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
10
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
11
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
12
|
+
# a separate helper file that requires the additional dependencies and performs
|
13
|
+
# the additional setup, and require it from the spec files that actually need
|
14
|
+
# it.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
42
|
+
# have no way to turn it off -- the option exists only for backwards
|
43
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
44
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
45
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
46
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
47
|
+
|
48
|
+
# The settings below are suggested to provide a good initial experience
|
49
|
+
# with RSpec, but feel free to customize to your heart's content.
|
50
|
+
=begin
|
51
|
+
# This allows you to limit a spec run to individual examples or groups
|
52
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
53
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
54
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
55
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
56
|
+
config.filter_run_when_matching :focus
|
57
|
+
|
58
|
+
# Allows RSpec to persist some state between runs in order to support
|
59
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
60
|
+
# you configure your source control system to ignore this file.
|
61
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
62
|
+
|
63
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
64
|
+
# recommended. For more details, see:
|
65
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
66
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
67
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
68
|
+
config.disable_monkey_patching!
|
69
|
+
|
70
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
71
|
+
# file, and it's useful to allow more verbose output when running an
|
72
|
+
# individual spec file.
|
73
|
+
if config.files_to_run.one?
|
74
|
+
# Use the documentation formatter for detailed output,
|
75
|
+
# unless a formatter has already been configured
|
76
|
+
# (e.g. via a command-line flag).
|
77
|
+
config.default_formatter = "doc"
|
78
|
+
end
|
79
|
+
|
80
|
+
# Print the 10 slowest examples and example groups at the
|
81
|
+
# end of the spec run, to help surface which specs are running
|
82
|
+
# particularly slow.
|
83
|
+
config.profile_examples = 10
|
84
|
+
|
85
|
+
# Run specs in random order to surface order dependencies. If you find an
|
86
|
+
# order dependency and want to debug it, you can fix the order by providing
|
87
|
+
# the seed, which is printed after each run.
|
88
|
+
# --seed 1234
|
89
|
+
config.order = :random
|
90
|
+
|
91
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
92
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
93
|
+
# test failures related to randomization by passing the same `--seed` value
|
94
|
+
# as the one that triggered the failure.
|
95
|
+
Kernel.srand config.seed
|
96
|
+
=end
|
97
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# Look in the page for a h1 tag with the "ActiveRecord Migration UI" text.
|
3
|
+
#
|
4
|
+
module BeTheActiveRecordMigrationUiGem
|
5
|
+
extend RSpec::Matchers::DSL
|
6
|
+
|
7
|
+
PAGE_TITLE = 'ActiveRecord Migration UI'.freeze
|
8
|
+
|
9
|
+
matcher :be_the_active_record_migration_ui_gem do
|
10
|
+
match do |page|
|
11
|
+
begin
|
12
|
+
page.find('h1', text: PAGE_TITLE)
|
13
|
+
true
|
14
|
+
rescue Capybara::ElementNotFound
|
15
|
+
false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
failure_message do |page|
|
19
|
+
"expected #{page.body} to have a h1 tag with the text " \
|
20
|
+
"\"#{PAGE_TITLE}\" but did not"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#
|
2
|
+
# Look in the page for a h1 tag with the "The dummy app!" text.
|
3
|
+
#
|
4
|
+
module BeTheDummyApp
|
5
|
+
extend RSpec::Matchers::DSL
|
6
|
+
|
7
|
+
PAGE_TITLE = 'The dummy app!'.freeze
|
8
|
+
|
9
|
+
matcher :be_the_dummy_app do
|
10
|
+
match do |page|
|
11
|
+
Capybara.string(page.body).has_selector?('h1', text: PAGE_TITLE)
|
12
|
+
end
|
13
|
+
failure_message do |page|
|
14
|
+
"expected #{page.body} to have a h1 tag with the text " \
|
15
|
+
"\"#{PAGE_TITLE}\" but did not"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# This collects the Selenium browser's console logs and raise the
|
5
|
+
# `DriverJSError` exception so that they are visible on a failure.
|
6
|
+
#
|
7
|
+
class DriverJSError < StandardError; end
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.after(:all) do
|
11
|
+
errors = page.driver.browser.manage.logs.get(:browser)
|
12
|
+
.select { |log| log.level == 'SEVERE' && log.message.present? }
|
13
|
+
.map(&:message)
|
14
|
+
.to_a
|
15
|
+
|
16
|
+
raise DriverJSError, errors.join("\n\n") if errors.present?
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'capybara/rails'
|
2
|
+
require 'selenium-webdriver'
|
3
|
+
|
4
|
+
# Capybara defaults to CSS3 selectors rather than XPath.
|
5
|
+
# If you'd prefer to use XPath, just uncomment this line and adjust any
|
6
|
+
# selectors in your step definitions to use the XPath syntax.
|
7
|
+
# Capybara.default_selector = :xpath
|
8
|
+
|
9
|
+
Capybara.register_driver :selenium do |app|
|
10
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
11
|
+
chromeOptions: {
|
12
|
+
args: [
|
13
|
+
'--disable-default-apps',
|
14
|
+
'--disable-extensions',
|
15
|
+
'--disable-infobars',
|
16
|
+
'--disable-notifications',
|
17
|
+
'--disable-password-generation',
|
18
|
+
'--disable-password-manager-reauthentication',
|
19
|
+
'--disable-password-separated-signin-flow',
|
20
|
+
'--disable-popup-blocking',
|
21
|
+
'--disable-save-password-bubble',
|
22
|
+
'--disable-translate',
|
23
|
+
'--incognito',
|
24
|
+
'--mute-audio',
|
25
|
+
'--no-default-browser-check',
|
26
|
+
'--window-size=1280,1024',
|
27
|
+
# '--auto-open-devtools-for-tabs',
|
28
|
+
# '--ignore-certificate-errors'
|
29
|
+
]
|
30
|
+
},
|
31
|
+
prefs: {
|
32
|
+
download: { prompt_for_download: false },
|
33
|
+
credentials_enable_service: false,
|
34
|
+
profile: {
|
35
|
+
password_manager_enabled: false,
|
36
|
+
default_content_settings: { popups: 0 },
|
37
|
+
content_settings: {
|
38
|
+
pattern_pairs: {
|
39
|
+
'*' => { 'multiple-automatic-downloads' => 1 }
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
)
|
45
|
+
|
46
|
+
client = Selenium::WebDriver::Remote::Http::Default.new
|
47
|
+
client.read_timeout = 120
|
48
|
+
|
49
|
+
selenium_url = ENV['SELENIUM_URL']
|
50
|
+
selenium_host = ENV['SELENIUM_HOST'] || 'selenium' unless selenium_url
|
51
|
+
selenium_port = ENV['SELENIUM_PORT'] || 4444 unless selenium_url
|
52
|
+
selenium_url ||= "http://#{selenium_host}:#{selenium_port}/wd/hub"
|
53
|
+
|
54
|
+
puts 'Configuring Capybara Selenium Driver with the selenium_url ' \
|
55
|
+
"#{selenium_url.inspect} ..."
|
56
|
+
|
57
|
+
Capybara::Selenium::Driver.new(
|
58
|
+
app,
|
59
|
+
browser: :remote,
|
60
|
+
url: selenium_url,
|
61
|
+
desired_capabilities: capabilities,
|
62
|
+
http_client: client
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Defines headless chrome as the Capybara JavaScript driver
|
67
|
+
Capybara.javascript_driver = :selenium
|
68
|
+
|
69
|
+
# Forces all tests to run in Javascript mode
|
70
|
+
Capybara.default_driver = Capybara.javascript_driver
|
71
|
+
|
72
|
+
Capybara.default_max_wait_time = 5
|
73
|
+
|
74
|
+
Capybara.server = :puma, { Silent: true }
|
75
|
+
|
76
|
+
Capybara.server_host = 'webpack'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
def the_db_migrate_folder
|
2
|
+
File.join(DUMMY_APP_ROOT_FOLDER, 'db', 'migrate')
|
3
|
+
end
|
4
|
+
|
5
|
+
def given_no_migration_script_exist
|
6
|
+
FileUtils.rm_rf the_db_migrate_folder
|
7
|
+
end
|
8
|
+
|
9
|
+
def given_the_db_migrate_folder_exists
|
10
|
+
FileUtils.mkdir_p the_db_migrate_folder
|
11
|
+
end
|
12
|
+
|
13
|
+
def given_the_db_migrate_folder_has_been_reseted
|
14
|
+
given_no_migration_script_exist
|
15
|
+
given_the_db_migrate_folder_exists
|
16
|
+
end
|
17
|
+
|
18
|
+
def when_i_access_the_app
|
19
|
+
visit '/'
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_migration_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Hain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actioncable
|
@@ -66,6 +66,104 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '4.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: tzinfo-data
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: capybara
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.24.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.24.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: capybara-screenshot
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.0.23
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.0.23
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: database_cleaner
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.7.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.7.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: puma
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 3.12.1
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 3.12.1
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec-rails
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 3.8.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 3.8.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: selenium-webdriver
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 3.142.3
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 3.142.3
|
69
167
|
- !ruby/object:Gem::Dependency
|
70
168
|
name: sqlite3
|
71
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,12 +222,91 @@ files:
|
|
124
222
|
- lib/active_record_migration_ui/logger.rb
|
125
223
|
- lib/active_record_migration_ui/middleware.rb
|
126
224
|
- lib/active_record_migration_ui/version.rb
|
127
|
-
- public/ar-migration-ui-packs/js/application-
|
128
|
-
- public/ar-migration-ui-packs/js/application-
|
129
|
-
- public/ar-migration-ui-packs/js/application-
|
130
|
-
- public/ar-migration-ui-packs/js/application-
|
225
|
+
- public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js
|
226
|
+
- public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js.gz
|
227
|
+
- public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js.map
|
228
|
+
- public/ar-migration-ui-packs/js/application-cf50329394df90f3aa11.js.map.gz
|
131
229
|
- public/ar-migration-ui-packs/manifest.json
|
132
230
|
- public/ar-migration-ui-packs/manifest.json.gz
|
231
|
+
- spec/dummy/Rakefile
|
232
|
+
- spec/dummy/app/assets/config/manifest.js
|
233
|
+
- spec/dummy/app/assets/javascripts/application.js
|
234
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
235
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
236
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
237
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
238
|
+
- spec/dummy/app/controllers/application_controller.rb
|
239
|
+
- spec/dummy/app/controllers/homes_controller.rb
|
240
|
+
- spec/dummy/app/helpers/application_helper.rb
|
241
|
+
- spec/dummy/app/javascript/packs/application.js
|
242
|
+
- spec/dummy/app/jobs/application_job.rb
|
243
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
244
|
+
- spec/dummy/app/models/application_record.rb
|
245
|
+
- spec/dummy/app/views/homes/index.html.erb
|
246
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
247
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
248
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
249
|
+
- spec/dummy/babel.config.js
|
250
|
+
- spec/dummy/bin/bundle
|
251
|
+
- spec/dummy/bin/rails
|
252
|
+
- spec/dummy/bin/rake
|
253
|
+
- spec/dummy/bin/setup
|
254
|
+
- spec/dummy/bin/update
|
255
|
+
- spec/dummy/bin/webpack
|
256
|
+
- spec/dummy/bin/webpack-dev-server
|
257
|
+
- spec/dummy/bin/yarn
|
258
|
+
- spec/dummy/config.ru
|
259
|
+
- spec/dummy/config/application.rb
|
260
|
+
- spec/dummy/config/boot.rb
|
261
|
+
- spec/dummy/config/cable.yml
|
262
|
+
- spec/dummy/config/credentials.yml.enc
|
263
|
+
- spec/dummy/config/database.yml
|
264
|
+
- spec/dummy/config/environment.rb
|
265
|
+
- spec/dummy/config/environments/development.rb
|
266
|
+
- spec/dummy/config/environments/production.rb
|
267
|
+
- spec/dummy/config/environments/test.rb
|
268
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
269
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
270
|
+
- spec/dummy/config/initializers/content_security_policy.rb
|
271
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
272
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
273
|
+
- spec/dummy/config/initializers/inflections.rb
|
274
|
+
- spec/dummy/config/initializers/mime_types.rb
|
275
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
276
|
+
- spec/dummy/config/locales/en.yml
|
277
|
+
- spec/dummy/config/puma.rb
|
278
|
+
- spec/dummy/config/routes.rb
|
279
|
+
- spec/dummy/config/spring.rb
|
280
|
+
- spec/dummy/config/webpack/development.js
|
281
|
+
- spec/dummy/config/webpack/environment.js
|
282
|
+
- spec/dummy/config/webpack/production.js
|
283
|
+
- spec/dummy/config/webpack/test.js
|
284
|
+
- spec/dummy/config/webpacker.yml
|
285
|
+
- spec/dummy/db/development.sqlite3
|
286
|
+
- spec/dummy/db/schema.rb
|
287
|
+
- spec/dummy/db/test.sqlite3
|
288
|
+
- spec/dummy/log/development.log
|
289
|
+
- spec/dummy/package.json
|
290
|
+
- spec/dummy/postcss.config.js
|
291
|
+
- spec/dummy/public/404.html
|
292
|
+
- spec/dummy/public/422.html
|
293
|
+
- spec/dummy/public/500.html
|
294
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
295
|
+
- spec/dummy/public/apple-touch-icon.png
|
296
|
+
- spec/dummy/public/favicon.ico
|
297
|
+
- spec/dummy/tmp/capybara/screenshot_2019-06-20-14-15-00.431.html
|
298
|
+
- spec/dummy/tmp/capybara/screenshot_2019-06-20-14-15-00.431.png
|
299
|
+
- spec/dummy/tmp/development_secret.txt
|
300
|
+
- spec/features/with_pending_migration_scripts_spec.rb
|
301
|
+
- spec/features/without_pending_migration_scripts_spec.rb
|
302
|
+
- spec/rails_helper.rb
|
303
|
+
- spec/spec_helper.rb
|
304
|
+
- spec/support/be_the_active_record_migration_ui_gem_matcher.rb
|
305
|
+
- spec/support/be_the_dummy_app_matcher.rb
|
306
|
+
- spec/support/browser_log.rb
|
307
|
+
- spec/support/capybara.rb
|
308
|
+
- spec/support/capybara_screenshot.rb
|
309
|
+
- spec/support/shared_steps.rb
|
133
310
|
homepage: https://gitlab.com/pharmony/active_record_migration_ui
|
134
311
|
licenses:
|
135
312
|
- MIT
|
@@ -157,4 +334,83 @@ rubygems_version: 3.0.3
|
|
157
334
|
signing_key:
|
158
335
|
specification_version: 4
|
159
336
|
summary: A web UI to execute pending Rails migrations
|
160
|
-
test_files:
|
337
|
+
test_files:
|
338
|
+
- spec/features/without_pending_migration_scripts_spec.rb
|
339
|
+
- spec/features/with_pending_migration_scripts_spec.rb
|
340
|
+
- spec/support/capybara.rb
|
341
|
+
- spec/support/be_the_dummy_app_matcher.rb
|
342
|
+
- spec/support/shared_steps.rb
|
343
|
+
- spec/support/capybara_screenshot.rb
|
344
|
+
- spec/support/browser_log.rb
|
345
|
+
- spec/support/be_the_active_record_migration_ui_gem_matcher.rb
|
346
|
+
- spec/spec_helper.rb
|
347
|
+
- spec/rails_helper.rb
|
348
|
+
- spec/dummy/db/development.sqlite3
|
349
|
+
- spec/dummy/db/test.sqlite3
|
350
|
+
- spec/dummy/db/schema.rb
|
351
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
352
|
+
- spec/dummy/app/jobs/application_job.rb
|
353
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
354
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
355
|
+
- spec/dummy/app/models/application_record.rb
|
356
|
+
- spec/dummy/app/helpers/application_helper.rb
|
357
|
+
- spec/dummy/app/javascript/packs/application.js
|
358
|
+
- spec/dummy/app/controllers/application_controller.rb
|
359
|
+
- spec/dummy/app/controllers/homes_controller.rb
|
360
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
361
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
362
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
363
|
+
- spec/dummy/app/views/homes/index.html.erb
|
364
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
365
|
+
- spec/dummy/app/assets/config/manifest.js
|
366
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
367
|
+
- spec/dummy/app/assets/javascripts/application.js
|
368
|
+
- spec/dummy/log/development.log
|
369
|
+
- spec/dummy/bin/setup
|
370
|
+
- spec/dummy/bin/webpack
|
371
|
+
- spec/dummy/bin/rails
|
372
|
+
- spec/dummy/bin/update
|
373
|
+
- spec/dummy/bin/yarn
|
374
|
+
- spec/dummy/bin/rake
|
375
|
+
- spec/dummy/bin/webpack-dev-server
|
376
|
+
- spec/dummy/bin/bundle
|
377
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
378
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
379
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
380
|
+
- spec/dummy/config/initializers/mime_types.rb
|
381
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
382
|
+
- spec/dummy/config/initializers/content_security_policy.rb
|
383
|
+
- spec/dummy/config/initializers/inflections.rb
|
384
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
385
|
+
- spec/dummy/config/credentials.yml.enc
|
386
|
+
- spec/dummy/config/spring.rb
|
387
|
+
- spec/dummy/config/webpack/test.js
|
388
|
+
- spec/dummy/config/webpack/development.js
|
389
|
+
- spec/dummy/config/webpack/environment.js
|
390
|
+
- spec/dummy/config/webpack/production.js
|
391
|
+
- spec/dummy/config/routes.rb
|
392
|
+
- spec/dummy/config/puma.rb
|
393
|
+
- spec/dummy/config/database.yml
|
394
|
+
- spec/dummy/config/webpacker.yml
|
395
|
+
- spec/dummy/config/application.rb
|
396
|
+
- spec/dummy/config/cable.yml
|
397
|
+
- spec/dummy/config/locales/en.yml
|
398
|
+
- spec/dummy/config/environment.rb
|
399
|
+
- spec/dummy/config/environments/production.rb
|
400
|
+
- spec/dummy/config/environments/development.rb
|
401
|
+
- spec/dummy/config/environments/test.rb
|
402
|
+
- spec/dummy/config/boot.rb
|
403
|
+
- spec/dummy/postcss.config.js
|
404
|
+
- spec/dummy/tmp/development_secret.txt
|
405
|
+
- spec/dummy/tmp/capybara/screenshot_2019-06-20-14-15-00.431.html
|
406
|
+
- spec/dummy/tmp/capybara/screenshot_2019-06-20-14-15-00.431.png
|
407
|
+
- spec/dummy/package.json
|
408
|
+
- spec/dummy/babel.config.js
|
409
|
+
- spec/dummy/config.ru
|
410
|
+
- spec/dummy/Rakefile
|
411
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
412
|
+
- spec/dummy/public/favicon.ico
|
413
|
+
- spec/dummy/public/422.html
|
414
|
+
- spec/dummy/public/apple-touch-icon.png
|
415
|
+
- spec/dummy/public/404.html
|
416
|
+
- spec/dummy/public/500.html
|