Last active
December 15, 2015 11:39
-
-
Save peakpg/5254600 to your computer and use it in GitHub Desktop.
How the Content API will behave in 4.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Case A | |
case_a = Cms::HtmlBlock.new(name: "Case A") | |
case_a.save | |
assert case_a.published? == true | |
# Case B | |
case_b = Cms::HtmlBlock.new(name: "Case B") | |
assert case_b.publish == false | |
assert case_b.persisted? == false | |
# Case C | |
case_c = Cms::HtmlBlock.new(name: "Case C") | |
case_c.save | |
case_c.publish # Unnecessary, returns false | |
assert case_c.versions.size == 1 | |
assert case_c.published? == true | |
# Case D | |
case_d = Cms::HtmlBlock.create(name: "Case D", publish_on_save: false) | |
case_d.name = "Case D - Updated" | |
case_d.publish | |
assert case_d.versions.size == 1 | |
assert case_d.name == "Case D" | |
assert case_d.changed? == true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment