2019-07-25 05:27:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-26 14:06:51 +00:00
|
|
|
shared_examples 'redirecting a legacy path' do |source, target|
|
|
|
|
include RSpec::Rails::RequestExampleGroup
|
|
|
|
|
|
|
|
it "redirects #{source} to #{target} when the resource does not exist" do
|
|
|
|
expect(get(source)).to redirect_to(target)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "does not redirect #{source} to #{target} when the resource exists" do
|
|
|
|
resource
|
|
|
|
|
|
|
|
expect(get(source)).not_to redirect_to(target)
|
|
|
|
end
|
|
|
|
end
|
2019-05-21 08:35:29 +00:00
|
|
|
|
|
|
|
shared_examples 'redirecting a legacy project path' do |source, target|
|
|
|
|
include RSpec::Rails::RequestExampleGroup
|
|
|
|
|
|
|
|
it "redirects #{source} to #{target}" do
|
|
|
|
expect(get(source)).to redirect_to(target)
|
|
|
|
end
|
|
|
|
end
|