60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/spec/dummy/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blocknotes/activeadmin_blaze_theme/d729757f66b22246fc10b98a29c6eebe2ca41da6/spec/dummy/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/spec/dummy/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blocknotes/activeadmin_blaze_theme/d729757f66b22246fc10b98a29c6eebe2ca41da6/spec/dummy/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/spec/dummy/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blocknotes/activeadmin_blaze_theme/d729757f66b22246fc10b98a29c6eebe2ca41da6/spec/dummy/public/favicon.ico
--------------------------------------------------------------------------------
/spec/rails_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'spec_helper'
4 |
5 | ENV['RAILS_ENV'] = 'test'
6 |
7 | require File.expand_path('dummy/config/environment.rb', __dir__)
8 |
9 | abort('The Rails environment is running in production mode!') if Rails.env.production?
10 |
11 | require 'rspec/rails'
12 | require 'capybara/rails'
13 |
14 | Dir[File.expand_path('support/**/*.rb', __dir__)].sort.each { |f| require f }
15 |
16 | # Force deprecations to raise an exception.
17 | ActiveSupport::Deprecation.behavior = :raise
18 |
19 | # Checks for pending migrations and applies them before tests are run.
20 | # If you are not using ActiveRecord, you can remove these lines.
21 | begin
22 | ActiveRecord::Migration.maintain_test_schema!
23 | rescue ActiveRecord::PendingMigrationError => e
24 | puts e.to_s.strip
25 | exit 1
26 | end
27 |
28 | RSpec.configure do |config|
29 | config.fixture_path = "#{::Rails.root}/spec/fixtures"
30 | config.infer_spec_type_from_file_location!
31 | config.filter_rails_from_backtrace!
32 |
33 | config.use_transactional_fixtures = true
34 | config.use_instantiated_fixtures = false
35 | config.render_views = false
36 |
37 | config.before(:suite) do
38 | intro = ('-' * 80)
39 | intro << "\n"
40 | intro << "- Ruby: #{RUBY_VERSION}\n"
41 | intro << "- Rails: #{Rails.version}\n"
42 | intro << "- ActiveAdmin: #{ActiveAdmin::VERSION}\n"
43 | intro << ('-' * 80)
44 |
45 | RSpec.configuration.reporter.message(intro)
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.configure do |config|
4 | config.disable_monkey_patching!
5 | config.filter_run focus: true
6 | config.filter_run_excluding changes_filesystem: true
7 | config.run_all_when_everything_filtered = true
8 |
9 | config.color = true
10 | config.tty = true
11 |
12 | config.example_status_persistence_file_path = '.rspec_failures'
13 | config.order = :random
14 | config.shared_context_metadata_behavior = :apply_to_host_groups
15 |
16 | config.expect_with :rspec do |expectations|
17 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true
18 | end
19 |
20 | config.mock_with :rspec do |mocks|
21 | mocks.verify_partial_doubles = true
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/spec/support/capybara.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Capybara.server = :puma
4 | Capybara.default_driver = Capybara.javascript_driver = :cuprite
5 |
6 | RSpec.configure do |config|
7 | # Make sure this hook runs before others
8 | config.prepend_before(:each, type: :system) do
9 | # Use JS driver always
10 | driven_by Capybara.javascript_driver
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/spec/support/capybara_cuprite.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'capybara/cuprite'
4 |
5 | Capybara.register_driver(:cuprite) do |app|
6 | browser_options = {}.tap do |opts|
7 | opts['no-sandbox'] = nil if ENV['CI']
8 | end
9 |
10 | Capybara::Cuprite::Driver.new(
11 | app,
12 | **{
13 | window_size: [1600, 1280],
14 | # See additional options for Dockerized environment in the respective section of this article
15 | browser_options: browser_options,
16 | # Increase Chrome startup wait time (required for stable CI builds)
17 | process_timeout: 15,
18 | # The number of seconds we'll wait for a response when communicating with browser. Default is 5
19 | timeout: 15,
20 | # Enable debugging capabilities
21 | inspector: true,
22 | # Allow running Chrome in a headful mode by setting HEADLESS env var to a falsey value
23 | headless: !ENV['CUPRITE_HEADLESS'].in?(%w[n 0 no false])
24 | }
25 | )
26 | end
27 |
--------------------------------------------------------------------------------
/spec/system/theme_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.describe 'Theme', type: :system do
4 | it 'applies the theme styles' do
5 | visit '/admin/posts'
6 |
7 | expect(page).to have_css('body.active_admin', style: { 'font-size': '12px' })
8 | expect(page).to have_css('body.active_admin a', text: /new post/i, style: { 'background-image': 'none' })
9 | expect(page).to have_css('body.active_admin #header', style: { 'background-image': 'none' })
10 | expect(page).to have_css('body.active_admin #title_bar', style: { 'box-shadow': 'none' })
11 | expect(page).to have_css('body.active_admin #main_content', style: { padding: '25px 20px' })
12 | expect(page).to have_css('body.active_admin #active_admin_content', style: { display: 'flex' })
13 | expect(page).to have_css('body.active_admin #footer', style: { position: 'absolute' })
14 | end
15 | end
16 |
--------------------------------------------------------------------------------