spec/admino/query/base_spec.rb in admino-0.0.1 vs spec/admino/query/base_spec.rb in admino-0.0.2

- old
+ new

@@ -48,9 +48,26 @@ expect(group.params).to eq params expect(group.i18n_key).to eq :group end end + context 'with a declared sorting' do + let(:config) { Configuration.new } + let(:sorting_config) do + config.add_sorting_scopes([:by_title, :by_date]) + end + + before do + sorting_config + end + + it 'returns a configured Sorting' do + sorting = query.sorting + expect(sorting.config).to eq sorting_config + expect(sorting.params).to eq params + end + end + describe '#scope' do let(:config) { Configuration.new } let(:result) { query.scope(starting_scope) } let(:starting_scope) { ScopeMock.new('explicit') }