From 2e05f3c82f24dd032d13e4b754df8ac1b8354ff7 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 8 Jul 2019 17:04:22 +0200 Subject: [PATCH] Prefix describe with RSpec. - This allows us to use the RSpec zero-monkey-patching mode https://relishapp.com/rspec/rspec-core/v/3-8/docs/configuration/zero-monkey-patching-mode --- spec/controllers/rails_admin/application_controller_spec.rb | 2 +- spec/controllers/rails_admin/main_controller_spec.rb | 2 +- spec/helpers/rails_admin/application_helper_spec.rb | 2 +- spec/helpers/rails_admin/form_builder_spec.rb | 2 +- spec/helpers/rails_admin/main_helper_spec.rb | 2 +- spec/integration/actions/base_spec.rb | 2 +- spec/integration/actions/bulk_delete_spec.rb | 2 +- spec/integration/actions/dashboard_spec.rb | 2 +- spec/integration/actions/delete_spec.rb | 2 +- spec/integration/actions/edit_spec.rb | 2 +- spec/integration/actions/export_spec.rb | 2 +- spec/integration/actions/index_spec.rb | 2 +- spec/integration/actions/new_spec.rb | 2 +- spec/integration/actions/show_spec.rb | 2 +- spec/integration/authorization/cancan_spec.rb | 2 +- spec/integration/authorization/cancancan_spec.rb | 2 +- spec/integration/authorization/pundit_spec.rb | 2 +- spec/integration/fields/action_text_spec.rb | 2 +- spec/integration/fields/active_record_enum_spec.rb | 2 +- spec/integration/fields/base_spec.rb | 2 +- spec/integration/fields/belongs_to_association_spec.rb | 2 +- spec/integration/fields/ck_editor_spec.rb | 2 +- spec/integration/fields/code_mirror_spec.rb | 2 +- spec/integration/fields/color_spec.rb | 2 +- spec/integration/fields/enum_spec.rb | 2 +- spec/integration/fields/floara_spec.rb | 2 +- .../fields/has_and_belongs_to_many_association_spec.rb | 2 +- spec/integration/fields/has_many_association_spec.rb | 2 +- spec/integration/fields/has_one_assosiation_spec.rb | 2 +- spec/integration/fields/hidden_spec.rb | 2 +- spec/integration/fields/multiple_carrierwave_spec.rb | 2 +- spec/integration/fields/paperclip_spec.rb | 2 +- spec/integration/fields/polymorphic_assosiation_spec.rb | 2 +- spec/integration/fields/serialized_spec.rb | 2 +- spec/integration/fields/simple_mde_spec.rb | 2 +- spec/integration/fields/wysihtml5_spec.rb | 2 +- spec/integration/history/rails_admin_history_spec.rb | 2 +- spec/integration/history/rails_admin_paper_trail_spec.rb | 2 +- spec/integration/rails_admin_spec.rb | 2 +- spec/integration/widgets/filtering_multi_select_spec.rb | 2 +- spec/rails_admin/abstract_model_spec.rb | 2 +- spec/rails_admin/active_record_extension_spec.rb | 2 +- spec/rails_admin/adapters/active_record/abstract_object_spec.rb | 2 +- spec/rails_admin/adapters/active_record/association_spec.rb | 2 +- spec/rails_admin/adapters/active_record/property_spec.rb | 2 +- spec/rails_admin/adapters/active_record_spec.rb | 2 +- spec/rails_admin/adapters/mongoid/abstract_object_spec.rb | 2 +- spec/rails_admin/adapters/mongoid/association_spec.rb | 2 +- spec/rails_admin/adapters/mongoid/property_spec.rb | 2 +- spec/rails_admin/adapters/mongoid_spec.rb | 2 +- spec/rails_admin/config/actions/base_spec.rb | 2 +- spec/rails_admin/config/actions_spec.rb | 2 +- spec/rails_admin/config/configurable_spec.rb | 2 +- spec/rails_admin/config/fields/association_spec.rb | 2 +- spec/rails_admin/config/fields/base_spec.rb | 2 +- spec/rails_admin/config/fields/types/action_text_spec.rb | 2 +- spec/rails_admin/config/fields/types/active_record_enum_spec.rb | 2 +- spec/rails_admin/config/fields/types/active_storage_spec.rb | 2 +- .../config/fields/types/belongs_to_association_spec.rb | 2 +- spec/rails_admin/config/fields/types/boolean_spec.rb | 2 +- spec/rails_admin/config/fields/types/bson_object_id_spec.rb | 2 +- spec/rails_admin/config/fields/types/carrierwave_spec.rb | 2 +- spec/rails_admin/config/fields/types/ck_editor_spec.rb | 2 +- spec/rails_admin/config/fields/types/code_mirror_spec.rb | 2 +- spec/rails_admin/config/fields/types/color_spec.rb | 2 +- spec/rails_admin/config/fields/types/date_spec.rb | 2 +- spec/rails_admin/config/fields/types/datetime_spec.rb | 2 +- spec/rails_admin/config/fields/types/decimal_spec.rb | 2 +- spec/rails_admin/config/fields/types/drangonfly_spec.rb | 2 +- spec/rails_admin/config/fields/types/enum_spec.rb | 2 +- spec/rails_admin/config/fields/types/file_upload_spec.rb | 2 +- spec/rails_admin/config/fields/types/float_spec.rb | 2 +- spec/rails_admin/config/fields/types/froala_spec.rb | 2 +- .../fields/types/has_and_belongs_to_many_association_spec.rb | 2 +- .../config/fields/types/has_many_association_spec.rb | 2 +- .../rails_admin/config/fields/types/has_one_association_spec.rb | 2 +- spec/rails_admin/config/fields/types/hidden_spec.rb | 2 +- spec/rails_admin/config/fields/types/inet_spec.rb | 2 +- spec/rails_admin/config/fields/types/integer_spec.rb | 2 +- spec/rails_admin/config/fields/types/json_spec.rb | 2 +- .../config/fields/types/multiple_active_storage_spec.rb | 2 +- .../config/fields/types/multiple_carrierwave_spec.rb | 2 +- .../config/fields/types/multiple_file_upload_spec.rb | 2 +- spec/rails_admin/config/fields/types/paperclip_spec.rb | 2 +- spec/rails_admin/config/fields/types/password_spec.rb | 2 +- spec/rails_admin/config/fields/types/serialized_spec.rb | 2 +- spec/rails_admin/config/fields/types/shrine_spec.rb | 2 +- spec/rails_admin/config/fields/types/simple_mde_spec.rb | 2 +- spec/rails_admin/config/fields/types/string_spec.rb | 2 +- spec/rails_admin/config/fields/types/text_spec.rb | 2 +- spec/rails_admin/config/fields/types/time_spec.rb | 2 +- spec/rails_admin/config/fields/types/timestamp_spec.rb | 2 +- spec/rails_admin/config/fields/types/uuid_spec.rb | 2 +- spec/rails_admin/config/fields/types/wysihtml5_spec.rb | 2 +- spec/rails_admin/config/fields_spec.rb | 2 +- spec/rails_admin/config/has_description_spec.rb | 2 +- spec/rails_admin/config/has_fields_spec.rb | 2 +- spec/rails_admin/config/lazy_model_spec.rb | 2 +- spec/rails_admin/config/model_spec.rb | 2 +- spec/rails_admin/config/proxyable_spec.rb | 2 +- spec/rails_admin/config/sections_spec.rb | 2 +- spec/rails_admin/config_spec.rb | 2 +- spec/rails_admin/install_generator_spec.rb | 2 +- spec/rails_admin/support/csv_converter_spec.rb | 2 +- spec/rails_admin/support/datetime_spec.rb | 2 +- spec/rails_admin/support/hash_helper_spec.rb | 2 +- spec/spec_helper.rb | 2 ++ 107 files changed, 108 insertions(+), 106 deletions(-) diff --git a/spec/controllers/rails_admin/application_controller_spec.rb b/spec/controllers/rails_admin/application_controller_spec.rb index 2150b4c388..9863c5f4e4 100644 --- a/spec/controllers/rails_admin/application_controller_spec.rb +++ b/spec/controllers/rails_admin/application_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::ApplicationController, type: :controller do +RSpec.describe RailsAdmin::ApplicationController, type: :controller do describe '#to_model_name' do it 'works with modules' do expect(controller.to_model_name('conversations~conversation')).to eq('Conversations::Conversation') diff --git a/spec/controllers/rails_admin/main_controller_spec.rb b/spec/controllers/rails_admin/main_controller_spec.rb index 0a9ec8c18e..e331341f52 100644 --- a/spec/controllers/rails_admin/main_controller_spec.rb +++ b/spec/controllers/rails_admin/main_controller_spec.rb @@ -1,7 +1,7 @@ # encoding: utf-8 require 'spec_helper' -describe RailsAdmin::MainController, type: :controller do +RSpec.describe RailsAdmin::MainController, type: :controller do routes { RailsAdmin::Engine.routes } def get(action, params) diff --git a/spec/helpers/rails_admin/application_helper_spec.rb b/spec/helpers/rails_admin/application_helper_spec.rb index d2b78dc12c..62c1eedc8c 100644 --- a/spec/helpers/rails_admin/application_helper_spec.rb +++ b/spec/helpers/rails_admin/application_helper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::ApplicationHelper, type: :helper do +RSpec.describe RailsAdmin::ApplicationHelper, type: :helper do describe '#authorized?' do let(:abstract_model) { RailsAdmin.config(FieldTest).abstract_model } diff --git a/spec/helpers/rails_admin/form_builder_spec.rb b/spec/helpers/rails_admin/form_builder_spec.rb index d74332511d..a95cb9b9ad 100644 --- a/spec/helpers/rails_admin/form_builder_spec.rb +++ b/spec/helpers/rails_admin/form_builder_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin::FormBuilder', type: :helper do +RSpec.describe 'RailsAdmin::FormBuilder', type: :helper do describe '#generate' do before do allow(helper).to receive(:authorized?).and_return(true) diff --git a/spec/helpers/rails_admin/main_helper_spec.rb b/spec/helpers/rails_admin/main_helper_spec.rb index c5d930d46d..670e5442b7 100644 --- a/spec/helpers/rails_admin/main_helper_spec.rb +++ b/spec/helpers/rails_admin/main_helper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::MainHelper, type: :helper do +RSpec.describe RailsAdmin::MainHelper, type: :helper do describe '#rails_admin_form_for' do let(:html_form) do helper.rails_admin_form_for(FieldTest.new, url: new_path(model_name: 'field_test')) {} diff --git a/spec/integration/actions/base_spec.rb b/spec/integration/actions/base_spec.rb index 8d6dae88a7..f677d2e8b9 100644 --- a/spec/integration/actions/base_spec.rb +++ b/spec/integration/actions/base_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Base action', type: :request do +RSpec.describe 'Base action', type: :request do subject { page } describe '#enabled?' do diff --git a/spec/integration/actions/bulk_delete_spec.rb b/spec/integration/actions/bulk_delete_spec.rb index 9768fc8c8e..4349dbeb3d 100644 --- a/spec/integration/actions/bulk_delete_spec.rb +++ b/spec/integration/actions/bulk_delete_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'BulkDelete action', type: :request do +RSpec.describe 'BulkDelete action', type: :request do subject { page } describe 'confirmation page' do diff --git a/spec/integration/actions/dashboard_spec.rb b/spec/integration/actions/dashboard_spec.rb index f4b1c6e41b..2f7c572b92 100644 --- a/spec/integration/actions/dashboard_spec.rb +++ b/spec/integration/actions/dashboard_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Dashboard action', type: :request do +RSpec.describe 'Dashboard action', type: :request do subject { page } it 'shows statistics by default' do diff --git a/spec/integration/actions/delete_spec.rb b/spec/integration/actions/delete_spec.rb index a18c0edfce..19a599e98d 100644 --- a/spec/integration/actions/delete_spec.rb +++ b/spec/integration/actions/delete_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Delete action', type: :request do +RSpec.describe 'Delete action', type: :request do subject { page } it "shows \"Delete model\"" do diff --git a/spec/integration/actions/edit_spec.rb b/spec/integration/actions/edit_spec.rb index a545a9cfd9..ed47d8db17 100644 --- a/spec/integration/actions/edit_spec.rb +++ b/spec/integration/actions/edit_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Edit action', type: :request do +RSpec.describe 'Edit action', type: :request do subject { page } describe 'page' do diff --git a/spec/integration/actions/export_spec.rb b/spec/integration/actions/export_spec.rb index 62c2187dbe..9e1db15152 100644 --- a/spec/integration/actions/export_spec.rb +++ b/spec/integration/actions/export_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'csv' -describe 'Export action', type: :request do +RSpec.describe 'Export action', type: :request do subject { page } before do diff --git a/spec/integration/actions/index_spec.rb b/spec/integration/actions/index_spec.rb index 37c5baeac6..4eadf32979 100644 --- a/spec/integration/actions/index_spec.rb +++ b/spec/integration/actions/index_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Index action', type: :request do +RSpec.describe 'Index action', type: :request do subject { page } describe 'page' do diff --git a/spec/integration/actions/new_spec.rb b/spec/integration/actions/new_spec.rb index c0171efc68..2e8d2bf725 100644 --- a/spec/integration/actions/new_spec.rb +++ b/spec/integration/actions/new_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'New action', type: :request do +RSpec.describe 'New action', type: :request do subject { page } describe 'page' do diff --git a/spec/integration/actions/show_spec.rb b/spec/integration/actions/show_spec.rb index 3becd4d114..5ee5463bca 100644 --- a/spec/integration/actions/show_spec.rb +++ b/spec/integration/actions/show_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Show action', type: :request do +RSpec.describe 'Show action', type: :request do subject { page } let(:team) { FactoryBot.create :team } diff --git a/spec/integration/authorization/cancan_spec.rb b/spec/integration/authorization/cancan_spec.rb index 539cc7c1e4..61d6c36c7e 100644 --- a/spec/integration/authorization/cancan_spec.rb +++ b/spec/integration/authorization/cancan_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin CanCan Authorization', type: :request do +RSpec.describe 'RailsAdmin CanCan Authorization', type: :request do class Ability include CanCan::Ability def initialize(user) diff --git a/spec/integration/authorization/cancancan_spec.rb b/spec/integration/authorization/cancancan_spec.rb index c50cdd09e8..cadba0efcd 100644 --- a/spec/integration/authorization/cancancan_spec.rb +++ b/spec/integration/authorization/cancancan_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin CanCanCan Authorization', type: :request do +RSpec.describe 'RailsAdmin CanCanCan Authorization', type: :request do class Ability include CanCan::Ability def initialize(user) diff --git a/spec/integration/authorization/pundit_spec.rb b/spec/integration/authorization/pundit_spec.rb index ed783ed1c6..1b3bd0fd00 100644 --- a/spec/integration/authorization/pundit_spec.rb +++ b/spec/integration/authorization/pundit_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin Pundit Authorization', type: :request do +RSpec.describe 'RailsAdmin Pundit Authorization', type: :request do subject { page } before do diff --git a/spec/integration/fields/action_text_spec.rb b/spec/integration/fields/action_text_spec.rb index 1a151f1aaa..e58a2680bd 100644 --- a/spec/integration/fields/action_text_spec.rb +++ b/spec/integration/fields/action_text_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'ActionText field', type: :request do +RSpec.describe 'ActionText field', type: :request do subject { page } it 'works without error', js: true do diff --git a/spec/integration/fields/active_record_enum_spec.rb b/spec/integration/fields/active_record_enum_spec.rb index a0796b8f0d..47863788d8 100644 --- a/spec/integration/fields/active_record_enum_spec.rb +++ b/spec/integration/fields/active_record_enum_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'ActiveRecordEnum field', type: :request, active_record: true do +RSpec.describe 'ActiveRecordEnum field', type: :request, active_record: true do subject { page } describe 'for string-keyed enum' do diff --git a/spec/integration/fields/base_spec.rb b/spec/integration/fields/base_spec.rb index ba841ba2a0..5bfdc2bd53 100644 --- a/spec/integration/fields/base_spec.rb +++ b/spec/integration/fields/base_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Base field', type: :request do +RSpec.describe 'Base field', type: :request do subject { page } describe '#default_value' do diff --git a/spec/integration/fields/belongs_to_association_spec.rb b/spec/integration/fields/belongs_to_association_spec.rb index df5e0a269d..ef09941b8a 100644 --- a/spec/integration/fields/belongs_to_association_spec.rb +++ b/spec/integration/fields/belongs_to_association_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'BelongsToAssociation field', type: :request do +RSpec.describe 'BelongsToAssociation field', type: :request do subject { page } describe 'with inverse_of option' do diff --git a/spec/integration/fields/ck_editor_spec.rb b/spec/integration/fields/ck_editor_spec.rb index 0c1727395e..41a132a412 100644 --- a/spec/integration/fields/ck_editor_spec.rb +++ b/spec/integration/fields/ck_editor_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CKEditor field', type: :request do +RSpec.describe 'CKEditor field', type: :request do subject { page } it 'works without error', js: true do diff --git a/spec/integration/fields/code_mirror_spec.rb b/spec/integration/fields/code_mirror_spec.rb index ed147589c7..dcf33e838d 100644 --- a/spec/integration/fields/code_mirror_spec.rb +++ b/spec/integration/fields/code_mirror_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CodeMirror field', type: :request do +RSpec.describe 'CodeMirror field', type: :request do subject { page } it 'works without error', js: true do diff --git a/spec/integration/fields/color_spec.rb b/spec/integration/fields/color_spec.rb index b75620bee1..fe48318340 100644 --- a/spec/integration/fields/color_spec.rb +++ b/spec/integration/fields/color_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Color field', type: :request do +RSpec.describe 'Color field', type: :request do subject { page } it 'shows input with class color' do diff --git a/spec/integration/fields/enum_spec.rb b/spec/integration/fields/enum_spec.rb index 2891253f1e..057e467781 100644 --- a/spec/integration/fields/enum_spec.rb +++ b/spec/integration/fields/enum_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Enum field', type: :request, active_record: true do +RSpec.describe 'Enum field', type: :request, active_record: true do subject { page } describe "when object responds to '\#{method}_enum'" do diff --git a/spec/integration/fields/floara_spec.rb b/spec/integration/fields/floara_spec.rb index bc18b3c5a2..c05aec9b84 100644 --- a/spec/integration/fields/floara_spec.rb +++ b/spec/integration/fields/floara_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Floara field', type: :request do +RSpec.describe 'Floara field', type: :request do subject { page } it 'works without error', js: true do diff --git a/spec/integration/fields/has_and_belongs_to_many_association_spec.rb b/spec/integration/fields/has_and_belongs_to_many_association_spec.rb index 5623be15b6..fd60afd949 100644 --- a/spec/integration/fields/has_and_belongs_to_many_association_spec.rb +++ b/spec/integration/fields/has_and_belongs_to_many_association_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'HasAndBelongsToManyAssociation field', type: :request do +RSpec.describe 'HasAndBelongsToManyAssociation field', type: :request do subject { page } context 'on create' do diff --git a/spec/integration/fields/has_many_association_spec.rb b/spec/integration/fields/has_many_association_spec.rb index 560f684012..2f474d8402 100644 --- a/spec/integration/fields/has_many_association_spec.rb +++ b/spec/integration/fields/has_many_association_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'HasManyAssociation field', type: :request do +RSpec.describe 'HasManyAssociation field', type: :request do subject { page } context 'when an association is readonly' do diff --git a/spec/integration/fields/has_one_assosiation_spec.rb b/spec/integration/fields/has_one_assosiation_spec.rb index aede2f64ea..f17cdcffdf 100644 --- a/spec/integration/fields/has_one_assosiation_spec.rb +++ b/spec/integration/fields/has_one_assosiation_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'HasOneAssociation field', type: :request do +RSpec.describe 'HasOneAssociation field', type: :request do subject { page } describe 'with inverse_of option' do diff --git a/spec/integration/fields/hidden_spec.rb b/spec/integration/fields/hidden_spec.rb index f6ef063a62..54426da477 100644 --- a/spec/integration/fields/hidden_spec.rb +++ b/spec/integration/fields/hidden_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Hidden field', type: :request do +RSpec.describe 'Hidden field', type: :request do subject { page } describe '#default_value' do diff --git a/spec/integration/fields/multiple_carrierwave_spec.rb b/spec/integration/fields/multiple_carrierwave_spec.rb index f83e545eb2..b620a3ad39 100644 --- a/spec/integration/fields/multiple_carrierwave_spec.rb +++ b/spec/integration/fields/multiple_carrierwave_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'MultipleCarrierwave field', type: :request, active_record: true do +RSpec.describe 'MultipleCarrierwave field', type: :request, active_record: true do subject { page } before do RailsAdmin.config FieldTest do diff --git a/spec/integration/fields/paperclip_spec.rb b/spec/integration/fields/paperclip_spec.rb index 1dcec0995e..fd2d232693 100644 --- a/spec/integration/fields/paperclip_spec.rb +++ b/spec/integration/fields/paperclip_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Paperclip field', type: :request do +RSpec.describe 'Paperclip field', type: :request do subject { page } it 'shows a file upload field' do diff --git a/spec/integration/fields/polymorphic_assosiation_spec.rb b/spec/integration/fields/polymorphic_assosiation_spec.rb index d3cd1f6187..5ffdc10e47 100644 --- a/spec/integration/fields/polymorphic_assosiation_spec.rb +++ b/spec/integration/fields/polymorphic_assosiation_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'PolymorphicAssociation field', type: :request do +RSpec.describe 'PolymorphicAssociation field', type: :request do subject { page } context 'on create' do diff --git a/spec/integration/fields/serialized_spec.rb b/spec/integration/fields/serialized_spec.rb index 72ad9abf2e..92428732e5 100644 --- a/spec/integration/fields/serialized_spec.rb +++ b/spec/integration/fields/serialized_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Serialized field', type: :request do +RSpec.describe 'Serialized field', type: :request do subject { page } context 'with serialized objects' do diff --git a/spec/integration/fields/simple_mde_spec.rb b/spec/integration/fields/simple_mde_spec.rb index f19a0f7667..6cbe1391e9 100644 --- a/spec/integration/fields/simple_mde_spec.rb +++ b/spec/integration/fields/simple_mde_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'SimpleMDE field', type: :request do +RSpec.describe 'SimpleMDE field', type: :request do subject { page } it 'works without error', js: true do diff --git a/spec/integration/fields/wysihtml5_spec.rb b/spec/integration/fields/wysihtml5_spec.rb index d730794c6c..4e1b63675f 100644 --- a/spec/integration/fields/wysihtml5_spec.rb +++ b/spec/integration/fields/wysihtml5_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Wysihtml5 field', type: :request do +RSpec.describe 'Wysihtml5 field', type: :request do subject { page } it 'works without error', js: true do diff --git a/spec/integration/history/rails_admin_history_spec.rb b/spec/integration/history/rails_admin_history_spec.rb index 134e422228..496fd2efdb 100644 --- a/spec/integration/history/rails_admin_history_spec.rb +++ b/spec/integration/history/rails_admin_history_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin History', type: :request, active_record: true do +RSpec.describe 'RailsAdmin History', type: :request, active_record: true do describe 'model history fetch' do before :each do RailsAdmin::History.delete_all diff --git a/spec/integration/history/rails_admin_paper_trail_spec.rb b/spec/integration/history/rails_admin_paper_trail_spec.rb index ed8c40d936..7e73ea843e 100644 --- a/spec/integration/history/rails_admin_paper_trail_spec.rb +++ b/spec/integration/history/rails_admin_paper_trail_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'paper_trail/frameworks/rspec' if defined?(PaperTrail) -describe 'RailsAdmin PaperTrail history', active_record: true do +RSpec.describe 'RailsAdmin PaperTrail history', active_record: true do before(:each) do skip 'Requires Ruby >= 2.3' if Rails::VERSION::STRING >= '5.2' && RUBY_VERSION =~ /^2\.2/ RailsAdmin.config do |config| diff --git a/spec/integration/rails_admin_spec.rb b/spec/integration/rails_admin_spec.rb index a191be635b..6bc676a2c2 100644 --- a/spec/integration/rails_admin_spec.rb +++ b/spec/integration/rails_admin_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin, type: :request do +RSpec.describe RailsAdmin, type: :request do subject { page } before do diff --git a/spec/integration/widgets/filtering_multi_select_spec.rb b/spec/integration/widgets/filtering_multi_select_spec.rb index a48afa8c63..41a82ea210 100644 --- a/spec/integration/widgets/filtering_multi_select_spec.rb +++ b/spec/integration/widgets/filtering_multi_select_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'FilteringMultiSelect widget', type: :request, js: true do +RSpec.describe 'FilteringMultiSelect widget', type: :request, js: true do subject { page } describe 'Choose all button' do diff --git a/spec/rails_admin/abstract_model_spec.rb b/spec/rails_admin/abstract_model_spec.rb index 06d32694eb..1a530df868 100644 --- a/spec/rails_admin/abstract_model_spec.rb +++ b/spec/rails_admin/abstract_model_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::AbstractModel do +RSpec.describe RailsAdmin::AbstractModel do describe '.all' do it 'returns abstract models for all models' do expect(RailsAdmin::AbstractModel.all.map(&:model)).to include Player, Team diff --git a/spec/rails_admin/active_record_extension_spec.rb b/spec/rails_admin/active_record_extension_spec.rb index 7180852152..c91979c359 100644 --- a/spec/rails_admin/active_record_extension_spec.rb +++ b/spec/rails_admin/active_record_extension_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require File.expand_path('../../../config/initializers/active_record_extensions', __FILE__) -describe 'ActiveRecord::Base', active_record: true do +RSpec.describe 'ActiveRecord::Base', active_record: true do describe '#safe_send' do it 'only calls #read_attribute once' do @player = Player.new diff --git a/spec/rails_admin/adapters/active_record/abstract_object_spec.rb b/spec/rails_admin/adapters/active_record/abstract_object_spec.rb index 25d0e6c837..5c859cc8da 100644 --- a/spec/rails_admin/adapters/active_record/abstract_object_spec.rb +++ b/spec/rails_admin/adapters/active_record/abstract_object_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin::Adapters::ActiveRecord::AbstractObject', active_record: true do +RSpec.describe 'RailsAdmin::Adapters::ActiveRecord::AbstractObject', active_record: true do describe 'proxy' do let(:object) { double('object') } let(:abstract_object) { RailsAdmin::Adapters::ActiveRecord::AbstractObject.new(object) } diff --git a/spec/rails_admin/adapters/active_record/association_spec.rb b/spec/rails_admin/adapters/active_record/association_spec.rb index 5c05176263..f9ccf0c0d7 100644 --- a/spec/rails_admin/adapters/active_record/association_spec.rb +++ b/spec/rails_admin/adapters/active_record/association_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'timecop' -describe 'RailsAdmin::Adapters::ActiveRecord::Association', active_record: true do +RSpec.describe 'RailsAdmin::Adapters::ActiveRecord::Association', active_record: true do before :all do RailsAdmin::AbstractModel.reset_polymorphic_parents diff --git a/spec/rails_admin/adapters/active_record/property_spec.rb b/spec/rails_admin/adapters/active_record/property_spec.rb index ca9e7a2fea..56021e1147 100644 --- a/spec/rails_admin/adapters/active_record/property_spec.rb +++ b/spec/rails_admin/adapters/active_record/property_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'timecop' -describe 'RailsAdmin::Adapters::ActiveRecord::Property', active_record: true do +RSpec.describe 'RailsAdmin::Adapters::ActiveRecord::Property', active_record: true do describe 'string field' do subject { RailsAdmin::AbstractModel.new('Player').properties.detect { |f| f.name == :name } } diff --git a/spec/rails_admin/adapters/active_record_spec.rb b/spec/rails_admin/adapters/active_record_spec.rb index dad6c7dd54..e9b2c993d3 100644 --- a/spec/rails_admin/adapters/active_record_spec.rb +++ b/spec/rails_admin/adapters/active_record_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'timecop' -describe 'RailsAdmin::Adapters::ActiveRecord', active_record: true do +RSpec.describe 'RailsAdmin::Adapters::ActiveRecord', active_record: true do let(:like) do if ['postgresql', 'postgis'].include? ::ActiveRecord::Base.configurations[Rails.env]['adapter'] '(field ILIKE ?)' diff --git a/spec/rails_admin/adapters/mongoid/abstract_object_spec.rb b/spec/rails_admin/adapters/mongoid/abstract_object_spec.rb index 29fcc0799f..40838dceb1 100644 --- a/spec/rails_admin/adapters/mongoid/abstract_object_spec.rb +++ b/spec/rails_admin/adapters/mongoid/abstract_object_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'rails_admin/adapters/mongoid/abstract_object' -describe 'RailsAdmin::Adapters::Mongoid::AbstractObject', mongoid: true do +RSpec.describe 'RailsAdmin::Adapters::Mongoid::AbstractObject', mongoid: true do before do @players = FactoryBot.create_list :player, 3 @draft = FactoryBot.create :draft diff --git a/spec/rails_admin/adapters/mongoid/association_spec.rb b/spec/rails_admin/adapters/mongoid/association_spec.rb index 1541f1b947..c66c07fed1 100644 --- a/spec/rails_admin/adapters/mongoid/association_spec.rb +++ b/spec/rails_admin/adapters/mongoid/association_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin::Adapters::Mongoid::Association', mongoid: true do +RSpec.describe 'RailsAdmin::Adapters::Mongoid::Association', mongoid: true do before :all do RailsAdmin::AbstractModel.reset_polymorphic_parents diff --git a/spec/rails_admin/adapters/mongoid/property_spec.rb b/spec/rails_admin/adapters/mongoid/property_spec.rb index 2876e72f98..a34228cb14 100644 --- a/spec/rails_admin/adapters/mongoid/property_spec.rb +++ b/spec/rails_admin/adapters/mongoid/property_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin::Adapters::Mongoid::Property', mongoid: true do +RSpec.describe 'RailsAdmin::Adapters::Mongoid::Property', mongoid: true do subject { RailsAdmin::AbstractModel.new(FieldTest).properties.detect { |p| p.name == field } } describe '_id field' do diff --git a/spec/rails_admin/adapters/mongoid_spec.rb b/spec/rails_admin/adapters/mongoid_spec.rb index 22bafab597..87e752e609 100644 --- a/spec/rails_admin/adapters/mongoid_spec.rb +++ b/spec/rails_admin/adapters/mongoid_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'RailsAdmin::Adapters::Mongoid', mongoid: true do +RSpec.describe 'RailsAdmin::Adapters::Mongoid', mongoid: true do describe '#associations' do it 'returns Association class' do expect(RailsAdmin::AbstractModel.new(Player).associations.first). diff --git a/spec/rails_admin/config/actions/base_spec.rb b/spec/rails_admin/config/actions/base_spec.rb index c9ca49fecc..8b6a5ac651 100644 --- a/spec/rails_admin/config/actions/base_spec.rb +++ b/spec/rails_admin/config/actions/base_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Actions::Base do +RSpec.describe RailsAdmin::Config::Actions::Base do describe '#visible?' do it 'excludes models not referenced in the only array' do RailsAdmin.config do |config| diff --git a/spec/rails_admin/config/actions_spec.rb b/spec/rails_admin/config/actions_spec.rb index 53e22d0e5e..23ca540105 100644 --- a/spec/rails_admin/config/actions_spec.rb +++ b/spec/rails_admin/config/actions_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Actions do +RSpec.describe RailsAdmin::Config::Actions do describe 'default' do it 'is as before' do expect(RailsAdmin::Config::Actions.all.collect(&:key)).to eq([:dashboard, :index, :show, :new, :edit, :export, :delete, :bulk_delete, :history_show, :history_index, :show_in_app]) diff --git a/spec/rails_admin/config/configurable_spec.rb b/spec/rails_admin/config/configurable_spec.rb index 225ac40177..a8f343b89c 100644 --- a/spec/rails_admin/config/configurable_spec.rb +++ b/spec/rails_admin/config/configurable_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Configurable do +RSpec.describe RailsAdmin::Config::Configurable do class ConfigurableTest include RailsAdmin::Config::Configurable diff --git a/spec/rails_admin/config/fields/association_spec.rb b/spec/rails_admin/config/fields/association_spec.rb index 3f36e3849f..7c3c660c6e 100644 --- a/spec/rails_admin/config/fields/association_spec.rb +++ b/spec/rails_admin/config/fields/association_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Association do +RSpec.describe RailsAdmin::Config::Fields::Association do describe '#pretty_value' do let(:player) { FactoryBot.create(:player, name: '
', team: FactoryBot.create(:team)) } let(:field) { RailsAdmin.config('Team').fields.detect { |f| f.name == :players } } diff --git a/spec/rails_admin/config/fields/base_spec.rb b/spec/rails_admin/config/fields/base_spec.rb index b6404a0dd4..2965d7cb86 100644 --- a/spec/rails_admin/config/fields/base_spec.rb +++ b/spec/rails_admin/config/fields/base_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Base do +RSpec.describe RailsAdmin::Config::Fields::Base do describe '#required' do it 'reads the on: :create/:update validate option' do RailsAdmin.config Ball do diff --git a/spec/rails_admin/config/fields/types/action_text_spec.rb b/spec/rails_admin/config/fields/types/action_text_spec.rb index a8d9358869..cc02ae8bc2 100644 --- a/spec/rails_admin/config/fields/types/action_text_spec.rb +++ b/spec/rails_admin/config/fields/types/action_text_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::ActionText do +RSpec.describe RailsAdmin::Config::Fields::Types::ActionText do it_behaves_like 'a generic field type', :action_text_field it_behaves_like 'a string-ish field type', :action_text_field diff --git a/spec/rails_admin/config/fields/types/active_record_enum_spec.rb b/spec/rails_admin/config/fields/types/active_record_enum_spec.rb index c6e2ff9a09..988c658d8e 100644 --- a/spec/rails_admin/config/fields/types/active_record_enum_spec.rb +++ b/spec/rails_admin/config/fields/types/active_record_enum_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::ActiveRecordEnum, active_record: true do +RSpec.describe RailsAdmin::Config::Fields::Types::ActiveRecordEnum, active_record: true do it_behaves_like 'a generic field type', :string_enum_field end diff --git a/spec/rails_admin/config/fields/types/active_storage_spec.rb b/spec/rails_admin/config/fields/types/active_storage_spec.rb index 3a72762528..ac379b827d 100644 --- a/spec/rails_admin/config/fields/types/active_storage_spec.rb +++ b/spec/rails_admin/config/fields/types/active_storage_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::ActiveStorage do +RSpec.describe RailsAdmin::Config::Fields::Types::ActiveStorage do it_behaves_like 'a generic field type', :string_field, :active_storage let(:record) { FactoryBot.create :field_test } diff --git a/spec/rails_admin/config/fields/types/belongs_to_association_spec.rb b/spec/rails_admin/config/fields/types/belongs_to_association_spec.rb index c9bdd79646..4a43150d8e 100644 --- a/spec/rails_admin/config/fields/types/belongs_to_association_spec.rb +++ b/spec/rails_admin/config/fields/types/belongs_to_association_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::BelongsToAssociation do +RSpec.describe RailsAdmin::Config::Fields::Types::BelongsToAssociation do it_behaves_like 'a generic field type', :integer_field, :belongs_to_association end diff --git a/spec/rails_admin/config/fields/types/boolean_spec.rb b/spec/rails_admin/config/fields/types/boolean_spec.rb index e3b4839d88..9543e2151e 100644 --- a/spec/rails_admin/config/fields/types/boolean_spec.rb +++ b/spec/rails_admin/config/fields/types/boolean_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Boolean do +RSpec.describe RailsAdmin::Config::Fields::Types::Boolean do it_behaves_like 'a generic field type', :boolean_field, :boolean end diff --git a/spec/rails_admin/config/fields/types/bson_object_id_spec.rb b/spec/rails_admin/config/fields/types/bson_object_id_spec.rb index d11ec37690..384f7ef4dd 100644 --- a/spec/rails_admin/config/fields/types/bson_object_id_spec.rb +++ b/spec/rails_admin/config/fields/types/bson_object_id_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::BsonObjectId do +RSpec.describe RailsAdmin::Config::Fields::Types::BsonObjectId do it_behaves_like 'a generic field type', :string_field, :bson_object_id describe '#parse_value' do diff --git a/spec/rails_admin/config/fields/types/carrierwave_spec.rb b/spec/rails_admin/config/fields/types/carrierwave_spec.rb index ce62d7b4da..d2666423d2 100644 --- a/spec/rails_admin/config/fields/types/carrierwave_spec.rb +++ b/spec/rails_admin/config/fields/types/carrierwave_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Carrierwave do +RSpec.describe RailsAdmin::Config::Fields::Types::Carrierwave do it_behaves_like 'a generic field type', :string_field, :carrierwave describe '#thumb_method' do diff --git a/spec/rails_admin/config/fields/types/ck_editor_spec.rb b/spec/rails_admin/config/fields/types/ck_editor_spec.rb index 5f58e8c2db..eb889ed2f9 100644 --- a/spec/rails_admin/config/fields/types/ck_editor_spec.rb +++ b/spec/rails_admin/config/fields/types/ck_editor_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::CKEditor do +RSpec.describe RailsAdmin::Config::Fields::Types::CKEditor do it_behaves_like 'a generic field type', :text_field, :ck_editor it_behaves_like 'a string-ish field type', :text_field, :ck_editor diff --git a/spec/rails_admin/config/fields/types/code_mirror_spec.rb b/spec/rails_admin/config/fields/types/code_mirror_spec.rb index 8a25f00903..5297c67c83 100644 --- a/spec/rails_admin/config/fields/types/code_mirror_spec.rb +++ b/spec/rails_admin/config/fields/types/code_mirror_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::CodeMirror do +RSpec.describe RailsAdmin::Config::Fields::Types::CodeMirror do it_behaves_like 'a generic field type', :text_field, :code_mirror it_behaves_like 'a string-ish field type', :text_field, :code_mirror diff --git a/spec/rails_admin/config/fields/types/color_spec.rb b/spec/rails_admin/config/fields/types/color_spec.rb index fcf97a143a..afe003e482 100644 --- a/spec/rails_admin/config/fields/types/color_spec.rb +++ b/spec/rails_admin/config/fields/types/color_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Color do +RSpec.describe RailsAdmin::Config::Fields::Types::Color do it_behaves_like 'a generic field type', :string_field, :color it_behaves_like 'a string-ish field type', :string_field, :color diff --git a/spec/rails_admin/config/fields/types/date_spec.rb b/spec/rails_admin/config/fields/types/date_spec.rb index 5c3cc2975c..ecc98d6468 100644 --- a/spec/rails_admin/config/fields/types/date_spec.rb +++ b/spec/rails_admin/config/fields/types/date_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Date do +RSpec.describe RailsAdmin::Config::Fields::Types::Date do it_behaves_like 'a generic field type', :date_field, :date describe '#formatted_value' do diff --git a/spec/rails_admin/config/fields/types/datetime_spec.rb b/spec/rails_admin/config/fields/types/datetime_spec.rb index 700c8a3efd..b48f1155ff 100644 --- a/spec/rails_admin/config/fields/types/datetime_spec.rb +++ b/spec/rails_admin/config/fields/types/datetime_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Datetime do +RSpec.describe RailsAdmin::Config::Fields::Types::Datetime do it_behaves_like 'a generic field type', :datetime_field, :datetime describe '#formatted_value' do diff --git a/spec/rails_admin/config/fields/types/decimal_spec.rb b/spec/rails_admin/config/fields/types/decimal_spec.rb index d69a91272c..308c4ff2d8 100644 --- a/spec/rails_admin/config/fields/types/decimal_spec.rb +++ b/spec/rails_admin/config/fields/types/decimal_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Decimal do +RSpec.describe RailsAdmin::Config::Fields::Types::Decimal do it_behaves_like 'a generic field type', :decimal_field, :decimal end diff --git a/spec/rails_admin/config/fields/types/drangonfly_spec.rb b/spec/rails_admin/config/fields/types/drangonfly_spec.rb index 8d4deb96a2..c0491a7b34 100644 --- a/spec/rails_admin/config/fields/types/drangonfly_spec.rb +++ b/spec/rails_admin/config/fields/types/drangonfly_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Dragonfly do +RSpec.describe RailsAdmin::Config::Fields::Types::Dragonfly do it_behaves_like 'a generic field type', :string_field, :dragonfly describe 'with a model which does not extend Dragonfly::Model' do diff --git a/spec/rails_admin/config/fields/types/enum_spec.rb b/spec/rails_admin/config/fields/types/enum_spec.rb index d597a2df30..16d12f8af6 100644 --- a/spec/rails_admin/config/fields/types/enum_spec.rb +++ b/spec/rails_admin/config/fields/types/enum_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Enum do +RSpec.describe RailsAdmin::Config::Fields::Types::Enum do it_behaves_like 'a generic field type', :string_field, :enum end diff --git a/spec/rails_admin/config/fields/types/file_upload_spec.rb b/spec/rails_admin/config/fields/types/file_upload_spec.rb index aba346fae1..48decb654d 100644 --- a/spec/rails_admin/config/fields/types/file_upload_spec.rb +++ b/spec/rails_admin/config/fields/types/file_upload_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::FileUpload do +RSpec.describe RailsAdmin::Config::Fields::Types::FileUpload do it_behaves_like 'a generic field type', :string_field, :file_upload describe '#allowed_methods' do diff --git a/spec/rails_admin/config/fields/types/float_spec.rb b/spec/rails_admin/config/fields/types/float_spec.rb index 3fcb47d89f..83ada22706 100644 --- a/spec/rails_admin/config/fields/types/float_spec.rb +++ b/spec/rails_admin/config/fields/types/float_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Float do +RSpec.describe RailsAdmin::Config::Fields::Types::Float do it_behaves_like 'a generic field type', :float_field, :float end diff --git a/spec/rails_admin/config/fields/types/froala_spec.rb b/spec/rails_admin/config/fields/types/froala_spec.rb index eba209ce27..2f1dd1fe68 100644 --- a/spec/rails_admin/config/fields/types/froala_spec.rb +++ b/spec/rails_admin/config/fields/types/froala_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Froala do +RSpec.describe RailsAdmin::Config::Fields::Types::Froala do it_behaves_like 'a generic field type', :text_field, :froala end diff --git a/spec/rails_admin/config/fields/types/has_and_belongs_to_many_association_spec.rb b/spec/rails_admin/config/fields/types/has_and_belongs_to_many_association_spec.rb index 831b3755db..70b6c6bbf6 100644 --- a/spec/rails_admin/config/fields/types/has_and_belongs_to_many_association_spec.rb +++ b/spec/rails_admin/config/fields/types/has_and_belongs_to_many_association_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::HasAndBelongsToManyAssociation do +RSpec.describe RailsAdmin::Config::Fields::Types::HasAndBelongsToManyAssociation do it_behaves_like 'a generic field type', :integer_field, :has_and_belongs_to_many_association end diff --git a/spec/rails_admin/config/fields/types/has_many_association_spec.rb b/spec/rails_admin/config/fields/types/has_many_association_spec.rb index e8fb5a9067..b1173a9fc9 100644 --- a/spec/rails_admin/config/fields/types/has_many_association_spec.rb +++ b/spec/rails_admin/config/fields/types/has_many_association_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::HasManyAssociation do +RSpec.describe RailsAdmin::Config::Fields::Types::HasManyAssociation do it_behaves_like 'a generic field type', :integer_field, :has_many_association end diff --git a/spec/rails_admin/config/fields/types/has_one_association_spec.rb b/spec/rails_admin/config/fields/types/has_one_association_spec.rb index e3e05204f6..78881e1640 100644 --- a/spec/rails_admin/config/fields/types/has_one_association_spec.rb +++ b/spec/rails_admin/config/fields/types/has_one_association_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::HasOneAssociation do +RSpec.describe RailsAdmin::Config::Fields::Types::HasOneAssociation do it_behaves_like 'a generic field type', :integer_field, :has_one_association end diff --git a/spec/rails_admin/config/fields/types/hidden_spec.rb b/spec/rails_admin/config/fields/types/hidden_spec.rb index a7f6cb2f56..9d3ce7d46d 100644 --- a/spec/rails_admin/config/fields/types/hidden_spec.rb +++ b/spec/rails_admin/config/fields/types/hidden_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Hidden do +RSpec.describe RailsAdmin::Config::Fields::Types::Hidden do it_behaves_like 'a generic field type', :integer_field, :hidden it_behaves_like 'a string-ish field type', :string_field, :hidden diff --git a/spec/rails_admin/config/fields/types/inet_spec.rb b/spec/rails_admin/config/fields/types/inet_spec.rb index 6d2fe48563..067a28765e 100644 --- a/spec/rails_admin/config/fields/types/inet_spec.rb +++ b/spec/rails_admin/config/fields/types/inet_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Inet do +RSpec.describe RailsAdmin::Config::Fields::Types::Inet do it_behaves_like 'a generic field type', :string_field, :inet end diff --git a/spec/rails_admin/config/fields/types/integer_spec.rb b/spec/rails_admin/config/fields/types/integer_spec.rb index b13b70778f..797f10c3ba 100644 --- a/spec/rails_admin/config/fields/types/integer_spec.rb +++ b/spec/rails_admin/config/fields/types/integer_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Integer do +RSpec.describe RailsAdmin::Config::Fields::Types::Integer do it_behaves_like 'a generic field type', :integer_field, :integer end diff --git a/spec/rails_admin/config/fields/types/json_spec.rb b/spec/rails_admin/config/fields/types/json_spec.rb index 2453b134fa..a773036393 100644 --- a/spec/rails_admin/config/fields/types/json_spec.rb +++ b/spec/rails_admin/config/fields/types/json_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Json do +RSpec.describe RailsAdmin::Config::Fields::Types::Json do let(:field) { RailsAdmin.config(FieldTest).fields.detect { |f| f.name == :json_field } } let(:object) { FieldTest.new } let(:bindings) do diff --git a/spec/rails_admin/config/fields/types/multiple_active_storage_spec.rb b/spec/rails_admin/config/fields/types/multiple_active_storage_spec.rb index a55f326f27..e24b04d7e4 100644 --- a/spec/rails_admin/config/fields/types/multiple_active_storage_spec.rb +++ b/spec/rails_admin/config/fields/types/multiple_active_storage_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::MultipleActiveStorage do +RSpec.describe RailsAdmin::Config::Fields::Types::MultipleActiveStorage do it_behaves_like 'a generic field type', :string_field, :multiple_active_storage let(:record) { FactoryBot.create :field_test } diff --git a/spec/rails_admin/config/fields/types/multiple_carrierwave_spec.rb b/spec/rails_admin/config/fields/types/multiple_carrierwave_spec.rb index 5a36b1548c..03ebf2a619 100644 --- a/spec/rails_admin/config/fields/types/multiple_carrierwave_spec.rb +++ b/spec/rails_admin/config/fields/types/multiple_carrierwave_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'base64' -describe RailsAdmin::Config::Fields::Types::MultipleCarrierwave do +RSpec.describe RailsAdmin::Config::Fields::Types::MultipleCarrierwave do it_behaves_like 'a generic field type', :string_field, :multiple_carrierwave describe '#thumb_method' do diff --git a/spec/rails_admin/config/fields/types/multiple_file_upload_spec.rb b/spec/rails_admin/config/fields/types/multiple_file_upload_spec.rb index a79f7e6d9c..66aa184105 100644 --- a/spec/rails_admin/config/fields/types/multiple_file_upload_spec.rb +++ b/spec/rails_admin/config/fields/types/multiple_file_upload_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::MultipleFileUpload do +RSpec.describe RailsAdmin::Config::Fields::Types::MultipleFileUpload do it_behaves_like 'a generic field type', :string_field, :multiple_file_upload describe '#allowed_methods' do diff --git a/spec/rails_admin/config/fields/types/paperclip_spec.rb b/spec/rails_admin/config/fields/types/paperclip_spec.rb index b8294fd628..168682f36a 100644 --- a/spec/rails_admin/config/fields/types/paperclip_spec.rb +++ b/spec/rails_admin/config/fields/types/paperclip_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Paperclip do +RSpec.describe RailsAdmin::Config::Fields::Types::Paperclip do it_behaves_like 'a generic field type', :string_field, :paperclip context 'when a *_file_name field exists but not decleared as has_attached_file' do diff --git a/spec/rails_admin/config/fields/types/password_spec.rb b/spec/rails_admin/config/fields/types/password_spec.rb index 62a4ff0e84..979bf89399 100644 --- a/spec/rails_admin/config/fields/types/password_spec.rb +++ b/spec/rails_admin/config/fields/types/password_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Password do +RSpec.describe RailsAdmin::Config::Fields::Types::Password do it_behaves_like 'a generic field type', :string_field, :password describe '#parse_input' do diff --git a/spec/rails_admin/config/fields/types/serialized_spec.rb b/spec/rails_admin/config/fields/types/serialized_spec.rb index a13104ce09..feb30b2e4c 100644 --- a/spec/rails_admin/config/fields/types/serialized_spec.rb +++ b/spec/rails_admin/config/fields/types/serialized_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Serialized do +RSpec.describe RailsAdmin::Config::Fields::Types::Serialized do it_behaves_like 'a generic field type', :text_field, :serialized end diff --git a/spec/rails_admin/config/fields/types/shrine_spec.rb b/spec/rails_admin/config/fields/types/shrine_spec.rb index 6b4b80be8b..8bde4c501f 100644 --- a/spec/rails_admin/config/fields/types/shrine_spec.rb +++ b/spec/rails_admin/config/fields/types/shrine_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Shrine do +RSpec.describe RailsAdmin::Config::Fields::Types::Shrine do context 'when asset is an image with versions' do let(:record) { FactoryBot.create :field_test, shrine_versioning_asset: FakeIO.new('dummy', filename: 'test.jpg', content_type: 'image/jpeg') } let(:field) do diff --git a/spec/rails_admin/config/fields/types/simple_mde_spec.rb b/spec/rails_admin/config/fields/types/simple_mde_spec.rb index e60a210825..b9236234fc 100644 --- a/spec/rails_admin/config/fields/types/simple_mde_spec.rb +++ b/spec/rails_admin/config/fields/types/simple_mde_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::SimpleMDE do +RSpec.describe RailsAdmin::Config::Fields::Types::SimpleMDE do it_behaves_like 'a generic field type', :text_field, :simple_mde it_behaves_like 'a string-ish field type', :text_field, :simple_mde diff --git a/spec/rails_admin/config/fields/types/string_spec.rb b/spec/rails_admin/config/fields/types/string_spec.rb index 55960432f0..50073ada07 100644 --- a/spec/rails_admin/config/fields/types/string_spec.rb +++ b/spec/rails_admin/config/fields/types/string_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::String do +RSpec.describe RailsAdmin::Config::Fields::Types::String do describe '#html_attributes' do before :each do RailsAdmin.config Ball do diff --git a/spec/rails_admin/config/fields/types/text_spec.rb b/spec/rails_admin/config/fields/types/text_spec.rb index ecf8014d5e..2351ecc728 100644 --- a/spec/rails_admin/config/fields/types/text_spec.rb +++ b/spec/rails_admin/config/fields/types/text_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Text do +RSpec.describe RailsAdmin::Config::Fields::Types::Text do it_behaves_like 'a generic field type', :text_field it_behaves_like 'a string-ish field type', :text_field diff --git a/spec/rails_admin/config/fields/types/time_spec.rb b/spec/rails_admin/config/fields/types/time_spec.rb index 13f091ca1a..ceb0ec5746 100644 --- a/spec/rails_admin/config/fields/types/time_spec.rb +++ b/spec/rails_admin/config/fields/types/time_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Time do +RSpec.describe RailsAdmin::Config::Fields::Types::Time do it_behaves_like 'a generic field type', :time_field, :time describe '#parse_input' do diff --git a/spec/rails_admin/config/fields/types/timestamp_spec.rb b/spec/rails_admin/config/fields/types/timestamp_spec.rb index d0f551f20e..e2afb91a0a 100644 --- a/spec/rails_admin/config/fields/types/timestamp_spec.rb +++ b/spec/rails_admin/config/fields/types/timestamp_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Timestamp, active_record: true do +RSpec.describe RailsAdmin::Config::Fields::Types::Timestamp, active_record: true do it_behaves_like 'a generic field type', :timestamp_field, :timestamp describe '#parse_input' do diff --git a/spec/rails_admin/config/fields/types/uuid_spec.rb b/spec/rails_admin/config/fields/types/uuid_spec.rb index cfd9745fea..c6a752697f 100644 --- a/spec/rails_admin/config/fields/types/uuid_spec.rb +++ b/spec/rails_admin/config/fields/types/uuid_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Uuid do +RSpec.describe RailsAdmin::Config::Fields::Types::Uuid do let(:uuid) { SecureRandom.uuid } let(:object) { FactoryBot.create(:field_test) } let(:field) { RailsAdmin.config(FieldTest).fields.detect { |f| f.name == :uuid_field } } diff --git a/spec/rails_admin/config/fields/types/wysihtml5_spec.rb b/spec/rails_admin/config/fields/types/wysihtml5_spec.rb index da72d8aa4b..e58dba7062 100644 --- a/spec/rails_admin/config/fields/types/wysihtml5_spec.rb +++ b/spec/rails_admin/config/fields/types/wysihtml5_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields::Types::Wysihtml5 do +RSpec.describe RailsAdmin::Config::Fields::Types::Wysihtml5 do it_behaves_like 'a generic field type', :text_field, :wysihtml5 it_behaves_like 'a string-ish field type', :text_field, :wysihtml5 diff --git a/spec/rails_admin/config/fields_spec.rb b/spec/rails_admin/config/fields_spec.rb index ab9c70bfa3..d9602b972b 100644 --- a/spec/rails_admin/config/fields_spec.rb +++ b/spec/rails_admin/config/fields_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Fields, mongoid: true do +RSpec.describe RailsAdmin::Config::Fields, mongoid: true do describe '.factory for self.referentials belongs_to' do it 'associates belongs_to _id foreign_key to a belongs_to association' do class MongoTree diff --git a/spec/rails_admin/config/has_description_spec.rb b/spec/rails_admin/config/has_description_spec.rb index b9b728e730..67897fdcae 100644 --- a/spec/rails_admin/config/has_description_spec.rb +++ b/spec/rails_admin/config/has_description_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::HasDescription do +RSpec.describe RailsAdmin::Config::HasDescription do it 'shows description message when added through the DSL' do RailsAdmin.config do |config| config.model Team do diff --git a/spec/rails_admin/config/has_fields_spec.rb b/spec/rails_admin/config/has_fields_spec.rb index aede11d2dd..613398fbec 100644 --- a/spec/rails_admin/config/has_fields_spec.rb +++ b/spec/rails_admin/config/has_fields_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::HasFields do +RSpec.describe RailsAdmin::Config::HasFields do it 'shows hidden fields when added through the DSL' do expect(RailsAdmin.config(Team).fields.detect { |f| f.name == :division_id }).not_to be_visible diff --git a/spec/rails_admin/config/lazy_model_spec.rb b/spec/rails_admin/config/lazy_model_spec.rb index 3eda2297ba..4fed5b2101 100644 --- a/spec/rails_admin/config/lazy_model_spec.rb +++ b/spec/rails_admin/config/lazy_model_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::LazyModel do +RSpec.describe RailsAdmin::Config::LazyModel do subject { RailsAdmin::Config::LazyModel.new(:Team, &block) } let(:block) { proc { register_instance_option('parameter') } } # an arbitrary instance method we can spy on diff --git a/spec/rails_admin/config/model_spec.rb b/spec/rails_admin/config/model_spec.rb index ddec6837d9..c0434a498f 100644 --- a/spec/rails_admin/config/model_spec.rb +++ b/spec/rails_admin/config/model_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Model do +RSpec.describe RailsAdmin::Config::Model do describe '#excluded?' do before do RailsAdmin.config do |config| diff --git a/spec/rails_admin/config/proxyable_spec.rb b/spec/rails_admin/config/proxyable_spec.rb index fee203e33c..2a0a98075b 100644 --- a/spec/rails_admin/config/proxyable_spec.rb +++ b/spec/rails_admin/config/proxyable_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Proxyable do +RSpec.describe RailsAdmin::Config::Proxyable do class ProxyableTest include RailsAdmin::Config::Proxyable diff --git a/spec/rails_admin/config/sections_spec.rb b/spec/rails_admin/config/sections_spec.rb index fa5fc5b089..ac0a64f6b1 100644 --- a/spec/rails_admin/config/sections_spec.rb +++ b/spec/rails_admin/config/sections_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config::Sections do +RSpec.describe RailsAdmin::Config::Sections do describe 'configure' do it 'configures without changing the section default list' do RailsAdmin.config Team do diff --git a/spec/rails_admin/config_spec.rb b/spec/rails_admin/config_spec.rb index 5a26927813..263975863d 100644 --- a/spec/rails_admin/config_spec.rb +++ b/spec/rails_admin/config_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RailsAdmin::Config do +RSpec.describe RailsAdmin::Config do describe '.included_models' do it 'only uses included models' do RailsAdmin.config.included_models = [Team, League] diff --git a/spec/rails_admin/install_generator_spec.rb b/spec/rails_admin/install_generator_spec.rb index 8ad338b6da..da5684e326 100644 --- a/spec/rails_admin/install_generator_spec.rb +++ b/spec/rails_admin/install_generator_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'generators/rails_admin/install_generator' -describe RailsAdmin::InstallGenerator, type: :generator do +RSpec.describe RailsAdmin::InstallGenerator, type: :generator do destination File.expand_path('../../dummy_app/tmp/generator', __FILE__) arguments ['admin'] diff --git a/spec/rails_admin/support/csv_converter_spec.rb b/spec/rails_admin/support/csv_converter_spec.rb index 9bf93404f2..8d0ff08fba 100644 --- a/spec/rails_admin/support/csv_converter_spec.rb +++ b/spec/rails_admin/support/csv_converter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RailsAdmin::CSVConverter do +RSpec.describe RailsAdmin::CSVConverter do it 'keeps headers ordering' do RailsAdmin.config(Player) do export do diff --git a/spec/rails_admin/support/datetime_spec.rb b/spec/rails_admin/support/datetime_spec.rb index b88e5a629d..cc404d74f3 100644 --- a/spec/rails_admin/support/datetime_spec.rb +++ b/spec/rails_admin/support/datetime_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RailsAdmin::Support::Datetime do +RSpec.describe RailsAdmin::Support::Datetime do describe '#to_momentjs' do { '%D de %M de %Y, %H:%M:%S' => 'MM/DD/YY [de] mm [de] YYYY, HH:mm:ss', diff --git a/spec/rails_admin/support/hash_helper_spec.rb b/spec/rails_admin/support/hash_helper_spec.rb index bbe39cd990..83744f7171 100644 --- a/spec/rails_admin/support/hash_helper_spec.rb +++ b/spec/rails_admin/support/hash_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RailsAdmin::HashHelper do +RSpec.describe RailsAdmin::HashHelper do let(:hash) do { 'subject' => 'Test', diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 96b3676fdb..7421e80342 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -61,6 +61,8 @@ def password_digest(password) c.syntax = :expect end + config.disable_monkey_patching! + config.include RSpec::Matchers config.include RailsAdmin::Engine.routes.url_helpers