Commit 5fb6c517 authored by Andreas Brandl's avatar Andreas Brandl

Adjust specs per review

parent 42e11aa6
...@@ -190,7 +190,7 @@ describe API::Helpers do ...@@ -190,7 +190,7 @@ describe API::Helpers do
end end
describe '#order_options_with_tie_breaker' do describe '#order_options_with_tie_breaker' do
let(:subject) { Class.new.include(described_class).new.order_options_with_tie_breaker } subject { Class.new.include(described_class).new.order_options_with_tie_breaker }
before do before do
allow_any_instance_of(described_class).to receive(:params).and_return(params) allow_any_instance_of(described_class).to receive(:params).and_return(params)
...@@ -201,7 +201,7 @@ describe API::Helpers do ...@@ -201,7 +201,7 @@ describe API::Helpers do
let(:params) { { order_by: 'name', sort: 'asc' } } let(:params) { { order_by: 'name', sort: 'asc' } }
it 'adds id based ordering with same direction as primary order' do it 'adds id based ordering with same direction as primary order' do
expect(subject).to eq({ 'name' => 'asc', 'id' => 'asc' }) is_expected.to eq({ 'name' => 'asc', 'id' => 'asc' })
end end
end end
...@@ -209,7 +209,7 @@ describe API::Helpers do ...@@ -209,7 +209,7 @@ describe API::Helpers do
let(:params) { { order_by: 'name', sort: 'desc' } } let(:params) { { order_by: 'name', sort: 'desc' } }
it 'adds id based ordering with same direction as primary order' do it 'adds id based ordering with same direction as primary order' do
expect(subject).to eq({ 'name' => 'desc', 'id' => 'desc' }) is_expected.to eq({ 'name' => 'desc', 'id' => 'desc' })
end end
end end
end end
...@@ -218,7 +218,7 @@ describe API::Helpers do ...@@ -218,7 +218,7 @@ describe API::Helpers do
let(:params) { { order_by: 'name' } } let(:params) { { order_by: 'name' } }
it 'adds ID ASC order' do it 'adds ID ASC order' do
expect(subject).to eq({ 'name' => nil, 'id' => 'asc' }) is_expected.to eq({ 'name' => nil, 'id' => 'asc' })
end end
end end
...@@ -226,7 +226,7 @@ describe API::Helpers do ...@@ -226,7 +226,7 @@ describe API::Helpers do
let(:params) { { order_by: 'id', sort: 'asc' } } let(:params) { { order_by: 'id', sort: 'asc' } }
it 'does not add an additional order' do it 'does not add an additional order' do
expect(subject).to eq({ 'id' => 'asc' }) is_expected.to eq({ 'id' => 'asc' })
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment