Check new enabled? logic on both Legislation::Process Phase and Publication classes

This commit is contained in:
Bertocq
2017-06-14 00:21:08 +02:00
parent a279e77c39
commit c18d1b6e8f
2 changed files with 4 additions and 4 deletions

View File

@@ -7,14 +7,14 @@ RSpec.describe Legislation::Process::Phase, type: :model do
it "checks debate phase" do
expect(process.debate_phase.enabled?).to be true
process.update_attributes(debate_start_date: nil, debate_end_date: nil)
process.update_attributes(debate_phase_enabled: false)
expect(process.debate_phase.enabled?).to be false
end
it "checks allegations phase" do
expect(process.allegations_phase.enabled?).to be true
process.update_attributes(allegations_start_date: nil, allegations_end_date: nil)
process.update_attributes(allegations_phase_enabled: false)
expect(process.allegations_phase.enabled?).to be false
end
end

View File

@@ -7,14 +7,14 @@ RSpec.describe Legislation::Process::Publication, type: :model do
it "checks draft publication" do
expect(process.draft_publication.enabled?).to be true
process.update_attributes(draft_publication_date: nil)
process.update_attributes(draft_publication_enabled: false)
expect(process.draft_publication.enabled?).to be false
end
it "checks result publication" do
expect(process.result_publication.enabled?).to be true
process.update_attributes(result_publication_date: nil)
process.update_attributes(result_publication_enabled: false)
expect(process.result_publication.enabled?).to be false
end
end