Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tests for trashed elements #40

Merged
merged 2 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
alchemy_branch:
- 5.0-stable
- 5.1-stable
- 5.2-stable
- main
env:
ALCHEMY_BRANCH: ${{ matrix.alchemy_branch }}
Expand Down
2 changes: 0 additions & 2 deletions spec/models/alchemy/json_api/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,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
Expand Down
24 changes: 0 additions & 24 deletions spec/models/alchemy/json_api/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,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) }

Expand Down Expand Up @@ -135,14 +127,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) }

Expand All @@ -169,14 +153,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) }

Expand Down
1 change: 0 additions & 1 deletion spec/serializers/alchemy/json_api/page_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
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] }

Expand Down