Skip to content

Commit d22054a

Browse files
authored
Merge pull request #3 from richmolj/stats2
Stats2
2 parents b391224 + 1628244 commit d22054a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/jsonapi_compliable/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JsonapiCompliable
2-
VERSION = "0.3.8"
2+
VERSION = "0.3.9"
33
end

spec/stats_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,12 @@ def index
169169
expect(json['meta']['stats']).to eq({ 'total' => { 'count' => 1 } })
170170
end
171171
end
172+
173+
context 'when requested stat not configured' do
174+
it 'raises error' do
175+
expect {
176+
get :index, params: { stats: { asdf: :count} }
177+
}.to raise_error(JsonapiCompliable::Errors::StatNotFound, "No stat configured for calculation :count on attribute 'asdf'")
178+
end
179+
end
172180
end

0 commit comments

Comments
 (0)