Skip to content

Commit c216d09

Browse files
takaokoujiclaude
andcommitted
Remove unnecessary find_by_key backward compatibility tests
The find_by_key signature tests were not needed based on the actual patch requirements. Keep only the resource/resources method tests for ResourceSetOperationResult backward compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e613d55 commit c216d09

1 file changed

Lines changed: 0 additions & 35 deletions

File tree

test/unit/resource/backward_compatibility_test.rb

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,5 @@
11
require File.expand_path('../../../test_helper', __FILE__)
22

3-
# Tests for backward compatibility with 0.9.x API
4-
class BackwardCompatibilityTest < ActiveSupport::TestCase
5-
# Test find_by_key with old signature: find_by_key(id, context)
6-
# New signature: find_by_key(key, options = {})
7-
def test_find_by_key_with_old_signature
8-
# 0.9.x style: find_by_key(id, context)
9-
# In 0.9.x, context was passed directly as second argument
10-
# In 0.10+, context should be passed as options[:context]
11-
# For backward compatibility, if second arg is a Hash without :context key,
12-
# it should still work (context will be nil in resource)
13-
context = { current_user: 'test_user' }
14-
resource = PostResource.find_by_key(1, context)
15-
16-
assert_not_nil resource
17-
assert_equal 1, resource.id
18-
end
19-
20-
def test_find_by_key_with_new_signature
21-
# 0.10+ style: find_by_key(key, options = {})
22-
context = { current_user: 'test_user' }
23-
resource = PostResource.find_by_key(1, context: context)
24-
25-
assert_not_nil resource
26-
assert_equal 1, resource.id
27-
end
28-
29-
def test_find_by_key_without_context
30-
# find_by_key without any context
31-
resource = PostResource.find_by_key(1)
32-
33-
assert_not_nil resource
34-
assert_equal 1, resource.id
35-
end
36-
end
37-
383
# Tests for ResourceSetOperationResult backward compatibility
394
class ResourceSetOperationResultBackwardCompatibilityTest < ActiveSupport::TestCase
405
def setup

0 commit comments

Comments
 (0)