diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0f97a1..bbc97cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: alchemy_branch: - 5.0-stable - 5.1-stable + - 5.2-stable - main env: ALCHEMY_BRANCH: ${{ matrix.alchemy_branch }} diff --git a/spec/models/alchemy/json_api/element_spec.rb b/spec/models/alchemy/json_api/element_spec.rb index 7345056..4f3de60 100644 --- a/spec/models/alchemy/json_api/element_spec.rb +++ b/spec/models/alchemy/json_api/element_spec.rb @@ -11,13 +11,11 @@ let!(:public_one) { FactoryBot.create(:alchemy_element, public: true) } let!(:non_public) { FactoryBot.create(:alchemy_element, public: false) } - let!(:trashed) { FactoryBot.create(:alchemy_element, public: true).tap(&:trash!) } it "returns public available elements" do # expecting the ids here because the factorys class is not our decorator class expect(available).to include(public_one.id) expect(available).to_not include(non_public.id) - expect(available).to_not include(trashed.id) end end end diff --git a/spec/models/alchemy/json_api/page_spec.rb b/spec/models/alchemy/json_api/page_spec.rb index 0750eb1..3514b4a 100644 --- a/spec/models/alchemy/json_api/page_spec.rb +++ b/spec/models/alchemy/json_api/page_spec.rb @@ -86,14 +86,6 @@ end end - context "with trashed elements" do - let!(:trashed_element) { FactoryBot.create(:alchemy_element, page: page).tap(&:trash!) } - - it "does not contain trashed elements" do - expect(all_element_ids).to_not include(trashed_element.id) - end - end - context "with hidden elements" do let!(:hidden_element) { FactoryBot.create(:alchemy_element, page: page, public: false) } @@ -136,14 +128,6 @@ end end - context "with trashed elements" do - let!(:trashed_element) { FactoryBot.create(:alchemy_element, page: page).tap(&:trash!) } - - it "does not contain trashed elements" do - expect(element_ids).to_not include(trashed_element.id) - end - end - context "with hidden elements" do let(:hidden_element) { FactoryBot.create(:alchemy_element, page: page, public: false) } @@ -170,14 +154,6 @@ expect(fixed_elements).to eq([element_3.id, element_1.id, element_2.id]) end - context "with trashed fixed elements" do - let!(:trashed_element) { FactoryBot.create(:alchemy_element, page: page, fixed: true).tap(&:trash!) } - - it "does not contain trashed fixed elements" do - expect(fixed_elements).to_not include(trashed_element.id) - end - end - context "with hidden fixed elements" do let!(:hidden_element) { FactoryBot.create(:alchemy_element, page: page, fixed: true, public: false) } diff --git a/spec/serializers/alchemy/json_api/page_serializer_spec.rb b/spec/serializers/alchemy/json_api/page_serializer_spec.rb index b6165e5..7037173 100644 --- a/spec/serializers/alchemy/json_api/page_serializer_spec.rb +++ b/spec/serializers/alchemy/json_api/page_serializer_spec.rb @@ -40,12 +40,11 @@ let!(:element) { FactoryBot.create(:alchemy_element, page: alchemy_page) } let!(:fixed_element) { FactoryBot.create(:alchemy_element, page: alchemy_page, fixed: true) } let!(:non_public_element) { FactoryBot.create(:alchemy_element, page: alchemy_page, public: false) } - let!(:trashed_element) { FactoryBot.create(:alchemy_element, page: alchemy_page).tap(&:trash!) } subject { serializer.serializable_hash[:data][:relationships] } describe "elements" do - it "does not include trashed, fixed or hidden elements" do + it "does not include fixed or hidden elements" do expect(subject[:elements]).to eq( data: [ { id: element.id.to_s, type: :element }, @@ -56,7 +55,7 @@ end describe "fixed_elements" do - it "does not include trashed, non-fixed or hidden elements" do + it "does not include non-fixed or hidden elements" do expect(subject[:fixed_elements]).to eq( data: [ { id: fixed_element.id.to_s, type: :element },