From 25315658bee5f626232f2e129131b79e05208647 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 17 Feb 2021 13:43:55 +0100 Subject: [PATCH 1/2] Fix pagination related specs Latest version of jsonapi.rb added "records" to the paginated result object. --- spec/requests/alchemy/json_api/layout_pages_spec.rb | 3 ++- spec/requests/alchemy/json_api/pages_spec.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/requests/alchemy/json_api/layout_pages_spec.rb b/spec/requests/alchemy/json_api/layout_pages_spec.rb index ec79dc6..94fb804 100644 --- a/spec/requests/alchemy/json_api/layout_pages_spec.rb +++ b/spec/requests/alchemy/json_api/layout_pages_spec.rb @@ -9,7 +9,7 @@ :public, :layoutpage, urlname: nil, - title: "Footer" + title: "Footer", ) end @@ -94,6 +94,7 @@ "last" => 3, "next" => 3, "prev" => 1, + "records" => 3, }, "total" => 3, }) diff --git a/spec/requests/alchemy/json_api/pages_spec.rb b/spec/requests/alchemy/json_api/pages_spec.rb index d4710fb..df092db 100644 --- a/spec/requests/alchemy/json_api/pages_spec.rb +++ b/spec/requests/alchemy/json_api/pages_spec.rb @@ -146,6 +146,7 @@ "last" => 4, "next" => 3, "prev" => 1, + "records" => 4, }, "total" => 4, }) From c556d79a36c020911b34b4351b0f70e6bf1e90b2 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 17 Feb 2021 13:46:43 +0100 Subject: [PATCH 2/2] Fix factory bot loading --- spec/rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 0bfd1d1..0adbbed 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -19,8 +19,8 @@ end require "alchemy/version" +require "factory_bot" if Alchemy.gem_version >= Gem::Version.new("5.2.0") - require "factory_bot" require "alchemy/test_support" FactoryBot.definition_file_paths.concat(Alchemy::TestSupport.factory_paths)