From dfa64d7462ad87e1c96d7274da56a65fa5b159f6 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Fri, 29 Nov 2019 14:42:58 +0000 Subject: [PATCH] Allows to run these specs individually --- spec/generators/assets/javascripts_generator_spec.rb | 2 +- spec/generators/assets/stylesheets_generator_spec.rb | 2 +- spec/generators/assets_generator_spec.rb | 2 +- spec/generators/install_generator_spec.rb | 4 ++-- spec/generators/routes_generator_spec.rb | 4 ++-- spec/generators/views/edit_generator_spec.rb | 3 +-- spec/generators/views/field_generator_spec.rb | 2 +- spec/generators/views/form_generator_spec.rb | 3 +-- spec/generators/views/index_generator_spec.rb | 3 +-- spec/generators/views/layout_generator_spec.rb | 2 +- spec/generators/views/navigation_generator_spec.rb | 3 +-- spec/generators/views/new_generator_spec.rb | 3 +-- spec/generators/views/show_generator_spec.rb | 3 +-- spec/generators/views_generator_spec.rb | 2 +- spec/lib/administrate/order_spec.rb | 1 + spec/lib/fields/deferred_spec.rb | 1 + spec/lib/fields/has_many_spec.rb | 1 + spec/lib/pages/form_spec.rb | 2 +- spec/lib/pages/show_spec.rb | 2 +- spec/lib/pages/table_spec.rb | 4 ---- spec/support/generator_spec_helpers.rb | 1 + 21 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 spec/lib/pages/table_spec.rb diff --git a/spec/generators/assets/javascripts_generator_spec.rb b/spec/generators/assets/javascripts_generator_spec.rb index b5735eb5e5..03b1114bfe 100644 --- a/spec/generators/assets/javascripts_generator_spec.rb +++ b/spec/generators/assets/javascripts_generator_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -require "generators/administrate/assets/javascripts_generator" require "support/generator_spec_helpers" +require "generators/administrate/assets/javascripts_generator" describe Administrate::Generators::Assets::JavascriptsGenerator, :generator do describe "administrate:assets:javascripts" do diff --git a/spec/generators/assets/stylesheets_generator_spec.rb b/spec/generators/assets/stylesheets_generator_spec.rb index cd7fc24c82..5985689f62 100644 --- a/spec/generators/assets/stylesheets_generator_spec.rb +++ b/spec/generators/assets/stylesheets_generator_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -require "generators/administrate/assets/stylesheets_generator" require "support/generator_spec_helpers" +require "generators/administrate/assets/stylesheets_generator" describe Administrate::Generators::Assets::StylesheetsGenerator, :generator do describe "administrate:assets:stylesheets" do diff --git a/spec/generators/assets_generator_spec.rb b/spec/generators/assets_generator_spec.rb index 53d0260051..0c54bce19e 100644 --- a/spec/generators/assets_generator_spec.rb +++ b/spec/generators/assets_generator_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -require "generators/administrate/assets/assets_generator" require "support/generator_spec_helpers" +require "generators/administrate/assets/assets_generator" describe Administrate::Generators::AssetsGenerator, :generator do describe "administrate:assets" do diff --git a/spec/generators/install_generator_spec.rb b/spec/generators/install_generator_spec.rb index 1ed3d5992b..6b3181629e 100644 --- a/spec/generators/install_generator_spec.rb +++ b/spec/generators/install_generator_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" -require "generators/administrate/install/install_generator" -require "support/generator_spec_helpers" require "support/constant_helpers" +require "support/generator_spec_helpers" +require "generators/administrate/install/install_generator" describe Administrate::Generators::InstallGenerator, :generator do after { reset_routes } diff --git a/spec/generators/routes_generator_spec.rb b/spec/generators/routes_generator_spec.rb index 8ac1b52840..2e17c1bc7f 100644 --- a/spec/generators/routes_generator_spec.rb +++ b/spec/generators/routes_generator_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" -require "generators/administrate/routes/routes_generator" -require "support/generator_spec_helpers" require "support/constant_helpers" +require "support/generator_spec_helpers" +require "generators/administrate/routes/routes_generator" describe Administrate::Generators::RoutesGenerator, :generator do before { stub_generator_dependencies } diff --git a/spec/generators/views/edit_generator_spec.rb b/spec/generators/views/edit_generator_spec.rb index 6645944db4..365eeab77c 100644 --- a/spec/generators/views/edit_generator_spec.rb +++ b/spec/generators/views/edit_generator_spec.rb @@ -1,6 +1,5 @@ -require "spec_helper" -require "generators/administrate/views/edit_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/edit_generator" describe Administrate::Generators::Views::EditGenerator, :generator do describe "administrate:views:edit" do diff --git a/spec/generators/views/field_generator_spec.rb b/spec/generators/views/field_generator_spec.rb index 1feb4e782c..295e4e053f 100644 --- a/spec/generators/views/field_generator_spec.rb +++ b/spec/generators/views/field_generator_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -require "generators/administrate/views/field_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/field_generator" describe Administrate::Generators::Views::FieldGenerator, :generator do context "for an existing field type" do diff --git a/spec/generators/views/form_generator_spec.rb b/spec/generators/views/form_generator_spec.rb index c2a3a9f078..71f2d1882a 100644 --- a/spec/generators/views/form_generator_spec.rb +++ b/spec/generators/views/form_generator_spec.rb @@ -1,6 +1,5 @@ -require "spec_helper" -require "generators/administrate/views/form_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/form_generator" describe Administrate::Generators::Views::FormGenerator, :generator do describe "administrate:views:form" do diff --git a/spec/generators/views/index_generator_spec.rb b/spec/generators/views/index_generator_spec.rb index 8afd5f5804..75901c83fc 100644 --- a/spec/generators/views/index_generator_spec.rb +++ b/spec/generators/views/index_generator_spec.rb @@ -1,6 +1,5 @@ -require "spec_helper" -require "generators/administrate/views/index_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/index_generator" describe Administrate::Generators::Views::IndexGenerator, :generator do describe "administrate:views:index" do diff --git a/spec/generators/views/layout_generator_spec.rb b/spec/generators/views/layout_generator_spec.rb index 3e0ea4893e..492dfce55f 100644 --- a/spec/generators/views/layout_generator_spec.rb +++ b/spec/generators/views/layout_generator_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -require "generators/administrate/views/layout_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/layout_generator" describe Administrate::Generators::Views::LayoutGenerator, :generator do describe "administrate:views:layout" do diff --git a/spec/generators/views/navigation_generator_spec.rb b/spec/generators/views/navigation_generator_spec.rb index d75cf5c3d0..051e9782c4 100644 --- a/spec/generators/views/navigation_generator_spec.rb +++ b/spec/generators/views/navigation_generator_spec.rb @@ -1,6 +1,5 @@ -require "spec_helper" -require "generators/administrate/views/navigation_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/navigation_generator" describe Administrate::Generators::Views::NavigationGenerator, :generator do describe "administrate:views:navigation" do diff --git a/spec/generators/views/new_generator_spec.rb b/spec/generators/views/new_generator_spec.rb index 5d958c552b..c9d6c60ea2 100644 --- a/spec/generators/views/new_generator_spec.rb +++ b/spec/generators/views/new_generator_spec.rb @@ -1,6 +1,5 @@ -require "spec_helper" -require "generators/administrate/views/new_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/new_generator" describe Administrate::Generators::Views::NewGenerator, :generator do describe "administrate:views:new" do diff --git a/spec/generators/views/show_generator_spec.rb b/spec/generators/views/show_generator_spec.rb index 482fb95d0d..ab9d0c62c0 100644 --- a/spec/generators/views/show_generator_spec.rb +++ b/spec/generators/views/show_generator_spec.rb @@ -1,6 +1,5 @@ -require "spec_helper" -require "generators/administrate/views/show_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/show_generator" describe Administrate::Generators::Views::ShowGenerator, :generator do describe "administrate:views:show" do diff --git a/spec/generators/views_generator_spec.rb b/spec/generators/views_generator_spec.rb index 49603ea62c..b6284c6f03 100644 --- a/spec/generators/views_generator_spec.rb +++ b/spec/generators/views_generator_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -require "generators/administrate/views/views_generator" require "support/generator_spec_helpers" +require "generators/administrate/views/views_generator" describe Administrate::Generators::ViewsGenerator, :generator do describe "administrate:views resource" do diff --git a/spec/lib/administrate/order_spec.rb b/spec/lib/administrate/order_spec.rb index afdabc7638..33bc27aeff 100644 --- a/spec/lib/administrate/order_spec.rb +++ b/spec/lib/administrate/order_spec.rb @@ -1,3 +1,4 @@ +require "active_record" require "administrate/order" describe Administrate::Order do diff --git a/spec/lib/fields/deferred_spec.rb b/spec/lib/fields/deferred_spec.rb index adc92b6fee..2dad847afb 100644 --- a/spec/lib/fields/deferred_spec.rb +++ b/spec/lib/fields/deferred_spec.rb @@ -1,4 +1,5 @@ require "administrate/field/deferred" +require "administrate/field/belongs_to" require "administrate/field/string" describe Administrate::Field::Deferred do diff --git a/spec/lib/fields/has_many_spec.rb b/spec/lib/fields/has_many_spec.rb index 7e47118662..15b0838a6e 100644 --- a/spec/lib/fields/has_many_spec.rb +++ b/spec/lib/fields/has_many_spec.rb @@ -1,3 +1,4 @@ +require "rails_helper" require "administrate/field/has_many" require "support/constant_helpers" require "support/mock_relation" diff --git a/spec/lib/pages/form_spec.rb b/spec/lib/pages/form_spec.rb index 8860b23661..e19c8f7d31 100644 --- a/spec/lib/pages/form_spec.rb +++ b/spec/lib/pages/form_spec.rb @@ -1,4 +1,4 @@ -require "administrate/page/form" +require "rails_helper" describe Administrate::Page::Form do describe "#page_title" do diff --git a/spec/lib/pages/show_spec.rb b/spec/lib/pages/show_spec.rb index f1d783f2b8..b83e53f731 100644 --- a/spec/lib/pages/show_spec.rb +++ b/spec/lib/pages/show_spec.rb @@ -1,4 +1,4 @@ -require "administrate/page/show" +require "rails_helper" describe Administrate::Page::Show do describe "#page_title" do diff --git a/spec/lib/pages/table_spec.rb b/spec/lib/pages/table_spec.rb deleted file mode 100644 index 86f581468c..0000000000 --- a/spec/lib/pages/table_spec.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "administrate/page/collection" - -describe Administrate::Page::Collection do -end diff --git a/spec/support/generator_spec_helpers.rb b/spec/support/generator_spec_helpers.rb index 1cf2162a6d..ec9f4e4c12 100644 --- a/spec/support/generator_spec_helpers.rb +++ b/spec/support/generator_spec_helpers.rb @@ -1,3 +1,4 @@ +require "rails_helper" require "ammeter/rspec/generator/example" require "ammeter/rspec/generator/matchers" require "ammeter/init"