diff --git a/lib/membership_comparison/term_comparison.rb b/lib/membership_comparison/term_comparison.rb index 4bed17f..3e1e67b 100644 --- a/lib/membership_comparison/term_comparison.rb +++ b/lib/membership_comparison/term_comparison.rb @@ -25,6 +25,7 @@ def _conflict? def _partial? !suggestion_started_after_statement_ended? && ( + no_term_or_statement_start? || term_started_during_statement? || (statement_open? && term_open? && term_started_after_statement?) ) @@ -40,5 +41,9 @@ def previous_term_still_open? !suggestion_started_after_statement_ended? && suggestion_started_after_statement_and_term? end + + def no_term_or_statement_start? + !statement_value && !statement_started? + end end end diff --git a/spec/membership_comparison_spec.rb b/spec/membership_comparison_spec.rb index 7e00dc7..ea36830 100644 --- a/spec/membership_comparison_spec.rb +++ b/spec/membership_comparison_spec.rb @@ -40,7 +40,7 @@ specify { expect(comparison.problems).to be_empty } end - xcontext 'existing base P39s' do + context 'existing base P39s' do let(:comparison) do MembershipComparison.new( existing: { @@ -52,7 +52,7 @@ end specify { expect(comparison.exact_matches).to be_empty } - specify { expect(comparison.partial_matches).to match_array(['wds:1030-1DAA-3101', 'wds:1030-1DAA-3102']) } # Currently fails + specify { expect(comparison.partial_matches).to match_array(['wds:1030-1DAA-3101', 'wds:1030-1DAA-3102']) } specify { expect(comparison.conflicts).to be_empty } specify { expect(comparison.problems['wds:1030-1DAA-3101']).to be_empty } specify { expect(comparison.problems['wds:1030-1DAA-3102']).to be_empty }