spec/grape/dsl/inside_route_spec.rb in grape-1.6.0 vs spec/grape/dsl/inside_route_spec.rb in grape-1.6.1
- old
+ new
@@ -41,20 +41,22 @@
describe 'thrown' do
before do
catch(:error) { subject.error! 'Not Found', 404 }
end
+
it 'sets status' do
expect(subject.status).to eq 404
end
end
describe 'default_error_status' do
before do
subject.namespace_inheritable(:default_error_status, 500)
catch(:error) { subject.error! 'Unknown' }
end
+
it 'sets status to default_error_status' do
expect(subject.status).to eq 500
end
end
@@ -134,11 +136,11 @@
expect { subject.status :foo_bar }
.to raise_error(ArgumentError, 'Status code :foo_bar is invalid.')
end
it 'accepts unknown Integer status codes' do
- expect { subject.status 210 }.to_not raise_error
+ expect { subject.status 210 }.not_to raise_error
end
it 'raises error if status is not a integer or symbol' do
expect { subject.status Object.new }
.to raise_error(ArgumentError, 'Status code must be Integer or Symbol.')
@@ -271,11 +273,11 @@
subject.header 'Content-Length', 123
subject.header 'Transfer-Encoding', 'base64'
end
it 'sends no deprecation warnings' do
- expect(subject).to_not receive(:warn)
+ expect(subject).not_to receive(:warn)
subject.sendfile file_path
end
it 'returns value wrapped in StreamResponse' do
@@ -332,11 +334,11 @@
subject.header 'Content-Length', 123
subject.header 'Transfer-Encoding', 'base64'
end
it 'emits no deprecation warnings' do
- expect(subject).to_not receive(:warn)
+ expect(subject).not_to receive(:warn)
subject.stream file_path
end
it 'returns file body wrapped in StreamResponse' do
@@ -382,10 +384,10 @@
subject.header 'Content-Length', 123
subject.header 'Transfer-Encoding', 'base64'
end
it 'emits no deprecation warnings' do
- expect(subject).to_not receive(:warn)
+ expect(subject).not_to receive(:warn)
subject.stream stream_object
end
it 'returns value wrapped in StreamResponse' do