Browse Source

Some test fixes

pull/2653/head
Manny Dinssa 2 years ago
parent
commit
e867421b53
  1. 2
      app/components/bulk_upload_summary_component.html.erb
  2. 2
      app/controllers/lettings_logs_controller.rb
  3. 2
      app/controllers/sales_logs_controller.rb
  4. 2
      app/services/bulk_upload/downloader.rb
  5. 8
      spec/features/organisation_spec.rb

2
app/components/bulk_upload_summary_component.html.erb

@ -27,7 +27,7 @@
[bulk_upload.total_logs_count, "total log"],
[setup_errors_count, "error on important questions", "errors on important questions"],
[critical_errors_count, "critical error"],
[potential_errors_count, "potential error"]
[potential_errors_count, "potential error"],
) %>
</div>
</footer>

2
app/controllers/lettings_logs_controller.rb

@ -139,7 +139,7 @@ class LettingsLogsController < LogsController
downloader = BulkUpload::Downloader.new(bulk_upload:)
if Rails.env.development?
send_file downloader.file_path, filename: bulk_upload.filename, type: "text/csv"
send_file downloader.path, filename: bulk_upload.filename, type: "text/csv"
else
presigned_url = downloader.presigned_url
redirect_to presigned_url

2
app/controllers/sales_logs_controller.rb

@ -109,7 +109,7 @@ class SalesLogsController < LogsController
downloader = BulkUpload::Downloader.new(bulk_upload:)
if Rails.env.development?
send_file downloader.file_path, filename: bulk_upload.filename, type: "text/csv"
send_file downloader.path, filename: bulk_upload.filename, type: "text/csv"
else
presigned_url = downloader.presigned_url
redirect_to presigned_url

2
app/services/bulk_upload/downloader.rb

@ -1,7 +1,7 @@
class BulkUpload::Downloader
attr_reader :bulk_upload
delegate :path, to: :file, prefix: true
delegate :path, to: :file
def initialize(bulk_upload:)
@bulk_upload = bulk_upload

8
spec/features/organisation_spec.rb

@ -136,7 +136,7 @@ RSpec.describe "User Features" do
end
it "shows a create button for that organisation" do
expect(page).to have_button("Create a new lettings log for this organisation")
expect(page).to have_button("Create a new lettings log")
end
it "shows a upload lettings logs in bulk link" do
@ -145,7 +145,7 @@ RSpec.describe "User Features" do
context "when creating a log for that organisation" do
it "pre-fills the value for owning organisation for that log" do
click_button("Create a new lettings log for this organisation")
click_button("Create a new lettings log")
click_link("Set up this lettings log")
expect(page).to have_content(org_name)
end
@ -231,7 +231,7 @@ RSpec.describe "User Features" do
end
it "shows a create button for that organisation" do
expect(page).to have_button("Create a new sales log for this organisation")
expect(page).to have_button("Create a new sales log")
end
it "shows a upload sales logs in bulk link" do
@ -240,7 +240,7 @@ RSpec.describe "User Features" do
context "when creating a log for that organisation" do
it "pre-fills the value for owning organisation for that log" do
click_button("Create a new sales log for this organisation")
click_button("Create a new sales log")
click_link("Set up this sales log")
expect(page).to have_content(org_name)
end

Loading…
Cancel
Save