use path_rewrite in commencer controller
This commit is contained in:
parent
516205efd9
commit
6677f31652
3 changed files with 25 additions and 0 deletions
|
@ -19,6 +19,18 @@ describe Users::CommencerController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when a path rewrite is present' do
|
||||
let(:path) { 'from' }
|
||||
let!(:path_rewrite) { PathRewrite.create(from: 'from', to: published_procedure.path) }
|
||||
|
||||
it 'redirects to the new path' do
|
||||
expect(subject.status).to eq(200)
|
||||
expect(subject).to render_template('show')
|
||||
expect(assigns(:procedure)).to eq published_procedure
|
||||
expect(assigns(:revision)).to eq published_procedure.published_revision
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the path is for a draft procedure' do
|
||||
let(:path) { draft_procedure.path }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue