Browse Source

Use govuk_button_link_to

pull/1620/head
Jack S 3 years ago
parent
commit
6e730b9a46
  1. 5
      app/views/logs/delete_confirmation.html.erb
  2. 4
      app/views/logs/edit.html.erb
  3. 4
      db/schema.rb
  4. 2
      spec/requests/lettings_logs_controller_spec.rb
  5. 2
      spec/requests/sales_logs_controller_spec.rb

5
app/views/logs/delete_confirmation.html.erb

@ -16,14 +16,11 @@
<%= govuk_button_to( <%= govuk_button_to(
"Delete this log", "Delete this log",
@log.lettings? ? lettings_log_path(@log) : sales_log_path(@log), @log.lettings? ? lettings_log_path(@log) : sales_log_path(@log),
class: "govuk-!-margin-right-6",
method: :delete method: :delete
) %> ) %>
<%= govuk_button_to( <%= govuk_button_link_to(
"Cancel", "Cancel",
@log.lettings? ? lettings_log_path(@log) : sales_log_path(@log), @log.lettings? ? lettings_log_path(@log) : sales_log_path(@log),
button: true,
method: :get,
secondary: true, secondary: true,
) %> ) %>
</div> </div>

4
app/views/logs/edit.html.erb

@ -53,11 +53,9 @@
<% end %> <% end %>
<% if LogPolicy.new(current_user, @log).destroy? %> <% if LogPolicy.new(current_user, @log).destroy? %>
<%= govuk_button_to( <%= govuk_button_link_to(
"Delete log", "Delete log",
lettings_log_delete_confirmation_path(@log), lettings_log_delete_confirmation_path(@log),
button: true,
method: :get,
warning: true, warning: true,
) %> ) %>
<% end %> <% end %>

4
db/schema.rb

@ -584,6 +584,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_05_05_105327) do
t.integer "ethnicbuy2" t.integer "ethnicbuy2"
t.integer "proplen_asked" t.integer "proplen_asked"
t.string "old_id" t.string "old_id"
t.integer "buy2living"
t.integer "prevtenbuy2"
t.integer "pregblank" t.integer "pregblank"
t.string "uprn" t.string "uprn"
t.integer "uprn_known" t.integer "uprn_known"
@ -592,8 +594,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_05_05_105327) do
t.string "address_line2" t.string "address_line2"
t.string "town_or_city" t.string "town_or_city"
t.string "county" t.string "county"
t.integer "buy2living"
t.integer "prevtenbuy2"
t.integer "nationalbuy2" t.integer "nationalbuy2"
t.integer "discounted_sale_value_check" t.integer "discounted_sale_value_check"
t.integer "student_not_child_value_check" t.integer "student_not_child_value_check"

2
spec/requests/lettings_logs_controller_spec.rb

@ -1377,7 +1377,7 @@ RSpec.describe LettingsLogsController, type: :request do
expect(page).to have_content("Are you sure you want to delete this log?") expect(page).to have_content("Are you sure you want to delete this log?")
expect(page).to have_button(text: "Delete this log") expect(page).to have_button(text: "Delete this log")
expect(page).to have_button(text: "Cancel") expect(page).to have_link(text: "Cancel", href: lettings_log_path(id))
end end
end end

2
spec/requests/sales_logs_controller_spec.rb

@ -722,7 +722,7 @@ RSpec.describe SalesLogsController, type: :request do
expect(page).to have_content("Are you sure you want to delete this log?") expect(page).to have_content("Are you sure you want to delete this log?")
expect(page).to have_button(text: "Delete this log") expect(page).to have_button(text: "Delete this log")
expect(page).to have_button(text: "Cancel") expect(page).to have_link(text: "Cancel", href: sales_log_path(id))
end end
end end

Loading…
Cancel
Save