spec/grape/dsl/routing_spec.rb in grape-0.14.0 vs spec/grape/dsl/routing_spec.rb in grape-0.15.0
- old
+ new
@@ -29,10 +29,17 @@
expect(subject).to receive(:namespace_inheritable).with(:root_prefix, prefix)
subject.prefix prefix
end
end
+ describe '.scope' do
+ it 'create a scope without affecting the URL' do
+ expect(subject).to receive(:within_namespace)
+ subject.scope {}
+ end
+ end
+
describe '.do_not_route_head!' do
it 'sets do not route head option' do
expect(subject).to receive(:namespace_inheritable).with(:do_not_route_head, true)
subject.do_not_route_head!
end
@@ -93,10 +100,10 @@
.to_not change(subject.endpoints, :count)
end
it 'generates correct endpoint options' do
allow(subject).to receive(:route_setting).with(:description).and_return(fiz: 'baz')
- allow(Grape::DSL::Configuration).to receive(:stacked_hash_to_hash).and_return(nuz: 'naz')
+ allow(subject).to receive(:namespace_stackable_with_hash).and_return(nuz: 'naz')
expect(Grape::Endpoint).to receive(:new) do |_inheritable_setting, endpoint_options|
expect(endpoint_options[:method]).to eq :get
expect(endpoint_options[:path]).to eq '/foo'
expect(endpoint_options[:for]).to eq subject