Skip to content

Commit 89e5da3

Browse files
committed
add failing spec for extract_attributes_and_predicates implementation
1 parent c55bd54 commit 89e5da3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

spec/filtering_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
end
1313
end
1414

15+
context 'attributes with underscore in name' do
16+
it 'detect _' do
17+
attributes, predicates = JSONAPI::Filtering
18+
.extract_attributes_and_predicates('notes_count_eq')
19+
expect(attributes).to eq(['notes_count'])
20+
expect(predicates.size).to eq(1)
21+
expect(predicates[0].name).to eq('eq')
22+
end
23+
end
24+
1525
context 'mixed predicates' do
1626
it 'extracts in order' do
1727
attributes, predicates = JSONAPI::Filtering
@@ -93,7 +103,7 @@
93103
}
94104
end
95105

96-
fit do
106+
it do
97107
expect(first_user.notes_count).to eq(0)
98108
expect(second_user.notes_count).to eq(1)
99109
expect(third_user.notes_count).to eq(0)

0 commit comments

Comments
 (0)