-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix double versioning on Domain & Contact models
- Loading branch information
Showing
8 changed files
with
31 additions
and
10 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
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
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 |
---|---|---|
|
@@ -21,6 +21,25 @@ def test_returns_version_list | |
assert_respond_to @record.versions.first, :item_id | ||
end | ||
|
||
def test_returns_version_count_on_domains | ||
@domain = domains(:airport) | ||
@domain.save | ||
|
||
assert_equal 1, @domain.versions.count | ||
|
||
@domain.name = 'domain.test' | ||
@domain.save! | ||
assert_equal 2, @domain.versions.count | ||
end | ||
|
||
def test_returns_version_count_on_users | ||
@user = users(:registrant) | ||
|
||
@user.email = '[email protected]' | ||
@user.save! | ||
assert_equal 1, @user.versions.count | ||
end | ||
|
||
def test_creates_new_version_upon_update | ||
@record = Post.create!(title: 'old title') | ||
original_record = @record.clone | ||
|
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