-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add `has_hoardable_rich_text` for `has_rich_text hoardable: true` * readme note * formatting
- Loading branch information
Showing
6 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--print-width=100 |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -592,6 +592,25 @@ def create_comments_and_destroy_post | |
end | ||
end | ||
|
||
test "has_hoardable_rich_text works" do | ||
profile = | ||
Profile.create!(user: user, email: "[email protected]", life_story: "<div>woke up</div>") | ||
datetime = DateTime.now | ||
profile.update!(life_story: "<div>went to sleep</div>") | ||
assert_equal "woke up", profile.at(datetime).life_story.to_plain_text | ||
end | ||
|
||
if SUPPORTS_ENCRYPTED_ACTION_TEXT | ||
test "has_hoardable_rich_text works for encrypted rich text" do | ||
profile = | ||
Profile.create!(user: user, email: "[email protected]", diary: "<div>i'm happy</div>") | ||
datetime = DateTime.now | ||
profile.update!(diary: "<div>i'm sad</div>") | ||
assert_equal "i'm happy", profile.at(datetime).diary.to_plain_text | ||
assert profile.diary.encrypted_attribute?("body") | ||
end | ||
end | ||
|
||
test "returns correct polymoprhic association via temporal has one relationship" do | ||
user = User.create!(name: "Joe Schmoe", bio: "<div>Bio</div>") | ||
post = PostWithRichText.create!(title: "Title", content: "<div>Content</div>", user: user) | ||
|