Created
September 23, 2015 11:43
-
-
Save alesya-h/7c01f7778c912b20f2f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = routes1 do |x| | |
x.get 'bar' | |
x.post 'baz' | |
x.scope 'nested' do |y| | |
y.get 'quux' | |
y.scope 'more-nesting' do |z| | |
z.post 'boo' | |
end | |
end | |
x.scope 'another-scope' do |y| | |
y.get 'aaa' | |
end | |
end | |
b = routes2 do | |
get 'bar' | |
post 'baz' | |
scope 'nested' do | |
get 'quux' | |
scope 'more-nesting' do | |
post 'boo' | |
end | |
end | |
scope 'another-scope' do | |
get 'aaa' | |
end | |
end | |
expect(a).to eq(b) | |
expect(a).to eq({ | |
get: ['bar'], | |
post: ['baz'], | |
scopes: { | |
'nested' => { | |
get: ['quux'], | |
scopes: { | |
'more-nesting' => { | |
post: ['boo'] | |
} | |
} | |
}, | |
'another-scope' => { | |
get: ['aaa'] | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment