Skip to content

Commit c8556cb

Browse files
committed
Rename FormsController to DraftController
This controller is now only responsible for rendering the draft form page. Rename it to reflect this, and move it into the Forms namespace for consistency.
1 parent 1c6b7e6 commit c8556cb

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class FormsController < WebController
1+
class Forms::DraftController < WebController
22
after_action :verify_authorized
33

44
def show

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
end
2020

2121
scope "forms/:form_id" do
22-
get "/" => "forms#show", as: :form
22+
get "/" => "forms/draft#show", as: :form
2323
get "/change-name" => "forms/change_name#edit", as: :change_form_name
2424
post "/change-name" => "forms/change_name#update"
2525

spec/requests/forms_controller_spec.rb renamed to spec/requests/forms/draft_controller_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "rails_helper"
22

3-
RSpec.describe FormsController, type: :request do
3+
RSpec.describe Forms::DraftController, type: :request do
44
let(:form) { create(:form) }
55
let(:group) { create(:group, organisation: standard_user.organisation) }
66
let(:user) { standard_user }
@@ -22,7 +22,7 @@
2222
end
2323

2424
it "renders the show template" do
25-
expect(response).to render_template("forms/show")
25+
expect(response).to render_template("show")
2626
end
2727

2828
it "includes a task list" do
@@ -36,7 +36,7 @@
3636
end
3737

3838
it "renders the show template" do
39-
expect(response).to render_template("forms/show")
39+
expect(response).to render_template("show")
4040
end
4141
end
4242

spec/views/forms/show.html.erb_spec.rb renamed to spec/views/forms/draft/show.html.erb_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "rails_helper"
22

3-
describe "forms/show.html.erb" do
3+
describe "forms/draft/show.html.erb" do
44
let(:user) { build :user }
55
let(:form) { create :form, :with_pages, name: "Form 1", form_slug: "form-1" }
66
let(:group) { create :group, name: "Group 1" }
@@ -16,7 +16,7 @@
1616
GroupForm.create!(form_id: form.id, group_id: group.id)
1717
end
1818

19-
render template: "forms/show"
19+
render
2020
end
2121

2222
it "contains page heading and sub-heading" do

0 commit comments

Comments
 (0)