Skip to content

Commit

Permalink
refacto
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Apr 24, 2024
1 parent 7d42432 commit 7d34ea6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions decidim-conferences/spec/models/decidim/conference_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,25 @@ module Decidim
end

describe "#has_published_registration_types?" do
subject { conference.has_published_registration_types? }

context "when conference has no registration type" do
it "returns false" do
expect(conference).not_to have_published_registration_types
end
it { is_expected.to be_falsey }
end

context "when conference has registration types" do
let!(:registration_types) do
create_list(:registration_type, 5, conference:)
end

it "return true" do
expect(conference).to have_published_registration_types
end
it { is_expected.to be_truthy }

context "and the registration types are unpublished" do
let!(:registration_types) do
create_list(:registration_type, 5, :unpublished, conference:)
end

it "returns false" do
expect(conference).not_to have_published_registration_types
end
it { is_expected.to be_falsey }
end
end
end
Expand Down

0 comments on commit 7d34ea6

Please sign in to comment.