diff --git a/app/decorators/work_decorator.rb b/app/decorators/work_decorator.rb
index d8f175709..eaeb17541 100644
--- a/app/decorators/work_decorator.rb
+++ b/app/decorators/work_decorator.rb
@@ -31,8 +31,12 @@ def show_migrate_button?
draft? && migrated && current_user_is_admin?
end
- def wizard_mode?
- draft? && !migrated
+ def edit_path
+ if draft? && !migrated # wizard mode
+ edit_work_wizard_path(work)
+ else
+ edit_work_path(work)
+ end
end
def file_list_path
diff --git a/app/views/works/show.html.erb b/app/views/works/show.html.erb
index 401b23653..26a084370 100644
--- a/app/views/works/show.html.erb
+++ b/app/views/works/show.html.erb
@@ -75,7 +75,7 @@
<% if @work.editable_in_current_state?(current_user) %>
- <%= link_to("Edit", edit_work_path(@work, wizard: @work_decorator.wizard_mode?), class: "btn btn-primary") %>
+ <%= link_to("Edit", @work_decorator.edit_path, class: "btn btn-primary") %>
<% end %>
<% if @work_decorator.show_approve_button? %>
<%= button_to("Approve Dataset", approve_work_path(@work), class: "btn btn-secondary", method: :post, id: "approve-button") %>
diff --git a/spec/system/work_spec.rb b/spec/system/work_spec.rb
index c2074e4a7..356df2d3a 100644
--- a/spec/system/work_spec.rb
+++ b/spec/system/work_spec.rb
@@ -181,7 +181,7 @@ def value_for(label)
it "uses the wizard if the work is in draft" do
sign_in user
visit work_path(draft_work)
- expect(page.html.include?("/works/#{draft_work.id}/edit?wizard=true")).to be true
+ expect(page.html.include?("/works/#{draft_work.id}/edit-wizard")).to be true
end
context "work is awaiting approval" do