sbfaulkner-sequel_container 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ module Sequel
30
30
 
31
31
  class_eval <<-CONTAINED_QUERY, __FILE__, __LINE__ + 1
32
32
  def #{object}?
33
- !#{object}_data.nil?
33
+ !#{object}_type.nil? && !#{object}_type.empty?
34
34
  end
35
35
  CONTAINED_QUERY
36
36
 
@@ -1,7 +1,7 @@
1
1
  SPEC = Gem::Specification.new do |s|
2
2
  # identify the gem
3
3
  s.name = "sequel_container"
4
- s.version = "1.0.3"
4
+ s.version = "1.0.4"
5
5
  s.author = "S. Brent Faulkner"
6
6
  s.email = "brentf@unwwwired.net"
7
7
  s.homepage = "http://github.com/sbfaulkner/sequel_container"
@@ -72,4 +72,22 @@ class SequelCascadingTest < Test::Unit::TestCase
72
72
  assert_equal Dir.tmpdir+"/companies/#{company.id}/biography.html", company.biography_path
73
73
  assert_equal "/companies/#{company.id}/biography.html", company.biography_url
74
74
  end
75
+
76
+ def test_should_be_empty_container_when_type_is_nil
77
+ company = Company.create :biography_data => ''
78
+ assert company.reload
79
+ assert !company.biography?
80
+ end
81
+
82
+ def test_should_be_empty_container_when_type_is_blank
83
+ company = Company.create :biography_type => '', :biography_data => ''
84
+ assert company.reload
85
+ assert !company.biography?
86
+ end
87
+
88
+ def test_should_contain_empty_document_when_type_is_set
89
+ company = Company.create :biography_type => 'text/plain', :biography_data => ''
90
+ assert company.reload
91
+ assert company.biography?
92
+ end
75
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbfaulkner-sequel_container
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - S. Brent Faulkner