spec/requests_spec.rb in grape-batch-1.0.4 vs spec/requests_spec.rb in grape-batch-1.1.0
- old
+ new
@@ -159,6 +159,32 @@
it { expect(response.status).to eq(200) }
it { expect(decode(response.body).size).to eq(2) }
end
end
end
+
+ describe '#configure' do
+ it { expect(Grape::Batch.configuration).to_not be_nil }
+
+ describe 'default_value' do
+ it { expect(Grape::Batch.configuration.path).to eq('/batch') }
+ it { expect(Grape::Batch.configuration.formatter).to eq(Grape::Batch::Response) }
+ it { expect(Grape::Batch.configuration.limit).to eq(10) }
+ end
+
+ describe '.configure' do
+ before do
+ allow( Grape::Batch).to receive(:configuration) do
+ config = Grape::Batch::Configuration.new
+ config.path = '/custom_path'
+ config.limit = 15
+ config
+ end
+ end
+
+ describe 'default_value' do
+ it { expect(Grape::Batch.configuration.path).to eq('/custom_path') }
+ it { expect(Grape::Batch.configuration.limit).to eq(15) }
+ end
+ end
+ end
end