Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/pipeline/events/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export default Route.extend({
return;
}

this.replaceWith('v2.pipeline.events', pipeline.id);
const { event_id: eventId } = this.paramsFor('pipeline.events.show');

if (eventId) {
this.replaceWith('v2.pipeline.events.show', pipeline.id, eventId);
} else {
this.replaceWith('v2.pipeline.events', pipeline.id);
}
},
setupController(controller, model = {}) {
this._super(controller, model);
Expand Down
7 changes: 7 additions & 0 deletions tests/acceptance/pipeline/events/events-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ module('Acceptance | pipelines/:id/events', hooks => {
setupApplicationTest(hooks);

const BASE_URL = `/v2/pipelines/${PIPELINE_ID}/events`;
const V1_BASE_URL = `/pipelines/${PIPELINE_ID}/events`;

test('visiting /pipelines/:id/events/:eventId redirects to the same event in v2', async assert => {
await visit(`${V1_BASE_URL}/${DEFAULT_EVENT_ID}`);

assert.strictEqual(currentURL(), `${BASE_URL}/${DEFAULT_EVENT_ID}`);
});

test('visiting /pipelines/:id/events requires being logged in', async assert => {
await invalidateSession();
Expand Down