Browse Source

Test for presence of buttons

pull/1620/head
Jack S 3 years ago
parent
commit
954d81d912
  1. 1
      app/models/log.rb
  2. 2
      spec/requests/lettings_logs_controller_spec.rb
  3. 2
      spec/requests/sales_logs_controller_spec.rb

1
app/models/log.rb

@ -169,6 +169,7 @@ class Log < ApplicationRecord
def setup_completed?
form.setup_sections.all? { |sections| sections.subsections.all? { |subsection| subsection.status(self) == :completed } }
end
private
# Handle logs that are older than previous collection start date

2
spec/requests/lettings_logs_controller_spec.rb

@ -1376,6 +1376,8 @@ RSpec.describe LettingsLogsController, type: :request do
expect(response).to have_http_status(:ok)
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: "Cancel")
end
end

2
spec/requests/sales_logs_controller_spec.rb

@ -721,6 +721,8 @@ RSpec.describe SalesLogsController, type: :request do
expect(response).to have_http_status(:ok)
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: "Cancel")
end
end

Loading…
Cancel
Save