We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73576f5 commit 6e93000Copy full SHA for 6e93000
spec/dynamoid/fields_spec.rb
@@ -78,14 +78,25 @@
78
end
79
80
81
- context 'when specify key option and key_type' do
82
- it 'hash_key attribute is defined by key_type type' do
+ context 'when :key and :key_type options specified' do
+ it 'changes a hash key attribute declared type' do
83
klass = new_class do
84
table key: :hash_key, key_type: :integer
85
86
87
expect(klass.attributes[:hash_key][:type]).to eq(:integer)
88
89
+
90
+ it 'changes a hash key attribute actual type' do
91
+ klass = new_class do
92
+ table key: :hash_key, key_type: :integer
93
+ field :name
94
+ end
95
96
+ klass.create!(hash_key: 42, name: 'Alex')
97
+ obj = klass.find(42)
98
+ expect(obj.name).to eq 'Alex'
99
100
101
102
0 commit comments