spec/grape/path_spec.rb in grape-0.6.1 vs spec/grape/path_spec.rb in grape-0.7.0
- old
+ new
@@ -55,29 +55,33 @@
end
describe "#uses_path_versioning?" do
it "is false when the version setting is nil" do
path = Path.new(anything, anything, version: nil)
- expect(path.uses_path_versioning?).to be_false
+ expect(path.uses_path_versioning?).to be false
end
it "is false when the version option is header" do
- path = Path.new(anything, anything, {
+ path = Path.new(
+ anything,
+ anything,
version: 'v1',
version_options: { using: :header }
- })
+ )
- expect(path.uses_path_versioning?).to be_false
+ expect(path.uses_path_versioning?).to be false
end
it "is true when the version option is path" do
- path = Path.new(anything, anything, {
+ path = Path.new(
+ anything,
+ anything,
version: 'v1',
version_options: { using: :path }
- })
+ )
- expect(path.uses_path_versioning?).to be_true
+ expect(path.uses_path_versioning?).to be true
end
end
describe "#has_namespace?" do
it "is false when the namespace is nil" do
@@ -124,11 +128,11 @@
end
describe "#path" do
context "mount_path" do
it "is not included when it is nil" do
- path = Path.new(nil, nil, { mount_path: '/foo/bar' })
+ path = Path.new(nil, nil, mount_path: '/foo/bar')
expect(path.path).to eql '/foo/bar'
end
it "is included when it is not nil" do
path = Path.new(nil, nil, {})
@@ -141,32 +145,38 @@
path = Path.new(nil, nil, {})
expect(path.path).to eql('/')
end
it "is included after the mount path" do
- path = Path.new(nil, nil, {
+ path = Path.new(
+ nil,
+ nil,
mount_path: '/foo',
root_prefix: '/hello'
- })
+ )
expect(path.path).to eql('/foo/hello')
end
end
it "uses the namespace after the mount path and root prefix" do
- path = Path.new(nil, 'namespace', {
+ path = Path.new(
+ nil,
+ 'namespace',
mount_path: '/foo',
root_prefix: '/hello'
- })
+ )
expect(path.path).to eql('/foo/hello/namespace')
end
it "uses the raw path after the namespace" do
- path = Path.new('raw_path', 'namespace', {
+ path = Path.new(
+ 'raw_path',
+ 'namespace',
mount_path: '/foo',
root_prefix: '/hello'
- })
+ )
expect(path.path).to eql('/foo/hello/namespace/raw_path')
end
end