spec/models/url_spec.rb in volt-0.9.4.pre1 vs spec/models/url_spec.rb in volt-0.9.4.pre2

- old
+ new

@@ -61,6 +61,22 @@ params = { view: 'blog/show', id: '1', query: 'val' } expect(subject.url_for params).to eq uri end end + + describe '#url_with' do + let(:uri) { 'http://voltframework.com:8888/path/1?query=val&page=1#fragment' } + let(:fake_router) do + router = Volt::Routes.new + + router.define do + client '/path/{{ id }}', view: 'blog/show' + end + end + + it 'regenerates the URL and merges the given params' do + params = { page: 1 } + expect(subject.url_with params).to eq uri + end + end end