Skip to content

Commit

Permalink
Merge pull request #33 from gregorw/feature/missing-value
Browse files Browse the repository at this point in the history
chore: add a spec when value is undiscriminable
  • Loading branch information
gregorw authored Apr 29, 2022
2 parents a4e694f + 52630af commit 39da77d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [x] Factory Bot: create :property, kind: 3 => should instantiate a child OptionProperty… => Works if constant OptionProperty is loaded
- [x] use `type` column with enum, int, string, etc.
- [x] ~~`self.abstract_class = true` ➔ This results in separate tables~~
- [x] What if value is not a “discriminable” value and class cannot be found?
- [ ] rubocop-minitest
- [ ] more tests / examples. [alias, non-alias][integer, string, boolean][enum, non-enum][type-column, non-type-column][multiple-values, single-values][subclasses, subsubclasses][hash-syntax, ocp-syntax]
- [ ] Documentation
Expand Down
5 changes: 5 additions & 0 deletions test/test_open_closed_principle_aliased_integer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def setup
end
end

def test_undiscriminable_value
Property.create kind: 99
assert_instance_of Property, Property.first
end

def test_sti_name_default
assert_equal 1, NumberProperty.sti_name
assert_equal 2, OptionProperty.sti_name
Expand Down

0 comments on commit 39da77d

Please sign in to comment.