зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-04 10:45:51 +03:00
test: update test suite config
Этот коммит содержится в:
1
.rspec
1
.rspec
@@ -1,2 +1 @@
|
|||||||
--require rails_helper
|
--require rails_helper
|
||||||
--format documentation
|
|
||||||
|
|||||||
@@ -13,11 +13,9 @@ end
|
|||||||
appraise 'rails70-activeadmin' do
|
appraise 'rails70-activeadmin' do
|
||||||
gem 'activeadmin'
|
gem 'activeadmin'
|
||||||
gem 'rails', '~> 7.0.0'
|
gem 'rails', '~> 7.0.0'
|
||||||
gem 'sprockets-rails'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
appraise 'rails71-activeadmin' do
|
appraise 'rails71-activeadmin' do
|
||||||
gem 'activeadmin'
|
gem 'activeadmin'
|
||||||
gem 'rails', '~> 7.1.0'
|
gem 'rails', '~> 7.1.0'
|
||||||
gem 'sprockets-rails'
|
|
||||||
end
|
end
|
||||||
|
|||||||
1
Gemfile
1
Gemfile
@@ -7,6 +7,7 @@ gemspec
|
|||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'puma'
|
gem 'puma'
|
||||||
gem 'sassc'
|
gem 'sassc'
|
||||||
|
gem 'sprockets-rails'
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ gem "rails", "~> 6.1.0"
|
|||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem "puma"
|
gem "puma"
|
||||||
gem "sassc"
|
gem "sassc"
|
||||||
|
gem "sprockets-rails"
|
||||||
gem "sqlite3"
|
gem "sqlite3"
|
||||||
gem "capybara"
|
gem "capybara"
|
||||||
gem "cuprite"
|
gem "cuprite"
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ DEPENDENCIES
|
|||||||
rubocop-rails
|
rubocop-rails
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
sassc
|
sassc
|
||||||
|
sprockets-rails
|
||||||
sqlite3
|
sqlite3
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ gem "rails", "~> 6.1.0"
|
|||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem "puma"
|
gem "puma"
|
||||||
gem "sassc"
|
gem "sassc"
|
||||||
|
gem "sprockets-rails"
|
||||||
gem "sqlite3"
|
gem "sqlite3"
|
||||||
gem "capybara"
|
gem "capybara"
|
||||||
gem "cuprite"
|
gem "cuprite"
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ DEPENDENCIES
|
|||||||
rubocop-rails
|
rubocop-rails
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
sassc
|
sassc
|
||||||
|
sprockets-rails
|
||||||
sqlite3
|
sqlite3
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ source "https://rubygems.org"
|
|||||||
|
|
||||||
gem "activeadmin"
|
gem "activeadmin"
|
||||||
gem "rails", "~> 7.0.0"
|
gem "rails", "~> 7.0.0"
|
||||||
gem "sprockets-rails"
|
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem "puma"
|
gem "puma"
|
||||||
gem "sassc"
|
gem "sassc"
|
||||||
|
gem "sprockets-rails"
|
||||||
gem "sqlite3"
|
gem "sqlite3"
|
||||||
gem "capybara"
|
gem "capybara"
|
||||||
gem "cuprite"
|
gem "cuprite"
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ source "https://rubygems.org"
|
|||||||
|
|
||||||
gem "activeadmin"
|
gem "activeadmin"
|
||||||
gem "rails", "~> 7.1.0"
|
gem "rails", "~> 7.1.0"
|
||||||
gem "sprockets-rails"
|
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem "puma"
|
gem "puma"
|
||||||
gem "sassc"
|
gem "sassc"
|
||||||
|
gem "sprockets-rails"
|
||||||
gem "sqlite3"
|
gem "sqlite3"
|
||||||
gem "capybara"
|
gem "capybara"
|
||||||
gem "cuprite"
|
gem "cuprite"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
ruby-2.7.1
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ruby 2.6.6
|
|
||||||
5
spec/dummy/app/admin/profiles.rb
Обычный файл
5
spec/dummy/app/admin/profiles.rb
Обычный файл
@@ -0,0 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
ActiveAdmin.register Profile do
|
||||||
|
permit_params :author_id, :description
|
||||||
|
end
|
||||||
@@ -24,7 +24,9 @@ class Author < ApplicationRecord
|
|||||||
"#{name} (#{age})"
|
"#{name} (#{age})"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
class << self
|
||||||
%w[age created_at email id name updated_at]
|
def ransackable_attributes(_auth_object = nil)
|
||||||
|
%w[age created_at email id name updated_at]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Post < ApplicationRecord
|
class Post < ApplicationRecord
|
||||||
enum state: %i[available unavailable arriving]
|
# enum state: %i[available unavailable arriving]
|
||||||
|
|
||||||
belongs_to :author, inverse_of: :posts, autosave: true
|
belongs_to :author, inverse_of: :posts, autosave: true
|
||||||
|
|
||||||
@@ -27,11 +27,13 @@ class Post < ApplicationRecord
|
|||||||
title.upcase
|
title.upcase
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
class << self
|
||||||
%w[author_id category created_at description dt id position published summary title updated_at]
|
def ransackable_attributes(auth_object = nil)
|
||||||
end
|
%w[author_id category created_at description dt id position published summary title updated_at]
|
||||||
|
end
|
||||||
|
|
||||||
def self.ransackable_associations(auth_object = nil)
|
def ransackable_associations(auth_object = nil)
|
||||||
%w[author author_profile images_attachments images_blobs post_tags tags]
|
%w[author author_profile images_attachments images_blobs post_tags tags]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ class PostTag < ApplicationRecord
|
|||||||
validates :post, presence: true
|
validates :post, presence: true
|
||||||
validates :tag, presence: true
|
validates :tag, presence: true
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
class << self
|
||||||
%w[created_at id post_id tag_id updated_at]
|
def ransackable_attributes(auth_object = nil)
|
||||||
|
%w[created_at id post_id tag_id updated_at]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,11 +3,19 @@
|
|||||||
class Profile < ApplicationRecord
|
class Profile < ApplicationRecord
|
||||||
belongs_to :author, inverse_of: :profile, touch: true
|
belongs_to :author, inverse_of: :profile, touch: true
|
||||||
|
|
||||||
def to_s
|
# has_rich_text :description
|
||||||
description
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.ransackable_attributes(auth_object = nil)
|
# def to_s
|
||||||
%w[author_id created_at description id updated_at]
|
# description
|
||||||
|
# end
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def ransackable_associations(auth_object = nil)
|
||||||
|
%w[author]
|
||||||
|
end
|
||||||
|
|
||||||
|
def ransackable_attributes(_auth_object = nil)
|
||||||
|
%w[author_id created_at description id updated_at]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,4 +3,14 @@
|
|||||||
class Tag < ApplicationRecord
|
class Tag < ApplicationRecord
|
||||||
has_many :post_tags, inverse_of: :tag, dependent: :destroy
|
has_many :post_tags, inverse_of: :tag, dependent: :destroy
|
||||||
has_many :posts, through: :post_tags
|
has_many :posts, through: :post_tags
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def ransackable_associations(auth_object = nil)
|
||||||
|
%w[post_tags posts]
|
||||||
|
end
|
||||||
|
|
||||||
|
def ransackable_attributes(auth_object = nil)
|
||||||
|
%w[created_at id id_value name updated_at]
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ module Dummy
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
config.active_record.legacy_connection_handling = false if Rails::VERSION::MAJOR > 6
|
config.active_record.legacy_connection_handling = false if Gem::Version.new(Rails.version) < Gem::Version.new('7.1')
|
||||||
|
|
||||||
|
config.before_configuration do
|
||||||
|
ActiveSupport::Cache.format_version = 7.0 if Gem::Version.new(Rails.version) > Gem::Version.new('7.0')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Rails.application.configure do
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||||
config.active_storage.service = :local
|
# config.active_storage.service = :local
|
||||||
|
|
||||||
# # Don't care if the mailer can't send.
|
# # Don't care if the mailer can't send.
|
||||||
# config.action_mailer.raise_delivery_errors = false
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Rails.application.configure do
|
|||||||
config.cache_store = :null_store
|
config.cache_store = :null_store
|
||||||
|
|
||||||
# Raise exceptions instead of rendering exception templates.
|
# Raise exceptions instead of rendering exception templates.
|
||||||
config.action_dispatch.show_exceptions = false
|
config.action_dispatch.show_exceptions = :none
|
||||||
|
|
||||||
# Disable request forgery protection in test environment.
|
# Disable request forgery protection in test environment.
|
||||||
config.action_controller.allow_forgery_protection = false
|
config.action_controller.allow_forgery_protection = false
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ require 'rspec/retry'
|
|||||||
Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f }
|
Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f }
|
||||||
|
|
||||||
# Force deprecations to raise an exception.
|
# Force deprecations to raise an exception.
|
||||||
ActiveSupport::Deprecation.behavior = :raise
|
# ActiveSupport::Deprecation.behavior = :raise
|
||||||
|
|
||||||
# Checks for pending migrations and applies them before tests are run.
|
# Checks for pending migrations and applies them before tests are run.
|
||||||
# If you are not using ActiveRecord, you can remove these lines.
|
# If you are not using ActiveRecord, you can remove these lines.
|
||||||
@@ -27,7 +27,6 @@ rescue ActiveRecord::PendingMigrationError => e
|
|||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.fixture_path = Rails.root.join('spec/fixtures').to_s
|
|
||||||
config.infer_spec_type_from_file_location!
|
config.infer_spec_type_from_file_location!
|
||||||
config.filter_rails_from_backtrace!
|
config.filter_rails_from_backtrace!
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user