Ref #25.
Showing the changes to test (1 of 4 files). Show all
Unified · Split
| @@ -45,9 +45,9 @@ class DocsDocTest < MiniTest::Spec · 44 unmodified lines | ||
| 45 | 45 | assert_equal 'doc', Docs::Doc.slug |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | − it "returns 'doc~42' when the class is Docs::Doc and its #version is '42'" do | |
| 49 | − stub(Docs::Doc).version { '42' } | |
| 50 | − assert_equal 'doc~42', Docs::Doc.slug | |
| 48 | + it "returns 'doc~4.2_lts' when the class is Docs::Doc and its #version is '42 LTS'" do | |
| 49 | + stub(Docs::Doc).version { '4.2 LTS' } | |
| 50 | + assert_equal 'doc~4.2_lts', Docs::Doc.slug | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | it "returns 'foo~42' when #slug has been set to 'foo' and #version to '42'" do |
| @@ -141,6 +141,12 @@ class DocsDocTest < MiniTest::Spec · 87 unmodified lines | ||
| 141 | 141 | assert_equal attribute, doc.as_json[attribute.to_sym] |
| 142 | 142 | end |
| 143 | 143 | end |
| 144 | + | |
| 145 | + it "includes the doc's version when it's defined and nil" do | |
| 146 | + refute doc.as_json.key?(:version) | |
| 147 | + doc.version = nil | |
| 148 | + assert doc.as_json.key?(:version) | |
| 149 | + end | |
| 144 | 150 | end |
| 145 | 151 | |
| 146 | 152 | describe ".store_page" do |