Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paranoia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paranoia
Commits
51f95410
Commit
51f95410
authored
Mar 07, 2017
by
edwardmp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change to assert_nil assertion to prevent warnings
parent
c117d04e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
test/paranoia_test.rb
+20
-20
No files found.
test/paranoia_test.rb
View file @
51f95410
...
...
@@ -118,9 +118,9 @@ class ParanoiaTest < test_framework
model
.
remove_called_variables
# clear called callback flags
model
.
destroy
assert_
equal
nil
,
model
.
instance_variable_get
(
:@update_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@save_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@validate_called
)
assert_
nil
model
.
instance_variable_get
(
:@update_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@save_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@validate_called
)
assert
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert
model
.
instance_variable_get
(
:@after_destroy_callback_called
)
...
...
@@ -134,12 +134,12 @@ class ParanoiaTest < test_framework
model
.
remove_called_variables
# clear called callback flags
model
.
delete
assert_
equal
nil
,
model
.
instance_variable_get
(
:@update_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@save_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@validate_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@after_commit_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@update_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@save_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@validate_called
)
assert_
nil
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@after_commit_callback_called
)
end
def
test_delete_in_transaction_behavior_for_plain_models_callbacks
...
...
@@ -150,11 +150,11 @@ class ParanoiaTest < test_framework
model
.
delete
end
assert_
equal
nil
,
model
.
instance_variable_get
(
:@update_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@save_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@validate_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert_
equal
nil
,
model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@update_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@save_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@validate_called
)
assert_
nil
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert
model
.
instance_variable_get
(
:@after_commit_callback_called
)
end
...
...
@@ -227,7 +227,7 @@ class ParanoiaTest < test_framework
end
def
test_default_sentinel_value
assert_
equal
nil
,
ParanoidModel
.
paranoia_sentinel_value
assert_
nil
ParanoidModel
.
paranoia_sentinel_value
end
def
test_without_default_scope_option
...
...
@@ -376,7 +376,7 @@ class ParanoiaTest < test_framework
model
=
CallbackModel
.
new
model
.
save
model
.
delete
assert_
equal
nil
,
model
.
instance_variable_get
(
:@destroy_callback_called
)
assert_
nil
model
.
instance_variable_get
(
:@destroy_callback_called
)
end
def
test_destroy_behavior_for_callbacks
...
...
@@ -949,8 +949,8 @@ class ParanoiaTest < test_framework
parent_model_with_counter_cache_column
=
ParentModelWithCounterCacheColumn
.
create
related_model
=
parent_model_with_counter_cache_column
.
related_models
.
create
assert_
equal
nil
,
related_model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
equal
nil
,
related_model
.
instance_variable_get
(
:@after_commit_on_destroy_callback_called
)
assert_
nil
related_model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
nil
related_model
.
instance_variable_get
(
:@after_commit_on_destroy_callback_called
)
related_model
.
destroy
...
...
@@ -995,8 +995,8 @@ class ParanoiaTest < test_framework
parent_model_with_counter_cache_column
=
ParentModelWithCounterCacheColumn
.
create
related_model
=
parent_model_with_counter_cache_column
.
related_models
.
create
assert_
equal
nil
,
related_model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
equal
nil
,
related_model
.
instance_variable_get
(
:@after_commit_on_destroy_callback_called
)
assert_
nil
related_model
.
instance_variable_get
(
:@after_destroy_callback_called
)
assert_
nil
related_model
.
instance_variable_get
(
:@after_commit_on_destroy_callback_called
)
related_model
.
really_destroy!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment