18 changed files with 118 additions and 34 deletions
@ -0,0 +1,14 @@ |
|||||||
|
<% content_for :before_content do %> |
||||||
|
<%= govuk_back_link href: @form.back_path %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<div class="govuk-grid-row"> |
||||||
|
<div class="govuk-grid-column-two-thirds"> |
||||||
|
<span class="govuk-caption-l">Bulk upload for lettings (<%= @bulk_upload.year_combo %>)</span> |
||||||
|
<h1 class="govuk-heading-l">These logs have been completed</h1> |
||||||
|
|
||||||
|
<p class="govuk-body">You have created logs from your bulk upload, and the logs are complete. Return to lettings logs to view them.</p> |
||||||
|
|
||||||
|
<%= govuk_button_link_to "Return to lettings logs", lettings_logs_path %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
<% content_for :before_content do %> |
||||||
|
<%= govuk_back_link href: @form.back_path %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<div class="govuk-grid-row"> |
||||||
|
<div class="govuk-grid-column-two-thirds"> |
||||||
|
<span class="govuk-caption-l">Bulk upload for sales (<%= @bulk_upload.year_combo %>)</span> |
||||||
|
<h1 class="govuk-heading-l">These logs have been completed</h1> |
||||||
|
|
||||||
|
<p class="govuk-body">You have created logs from your bulk upload, and the logs are complete. Return to sales logs to view them.</p> |
||||||
|
|
||||||
|
<%= govuk_button_link_to "Return to sales logs", sales_logs_path %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
require "rails_helper" |
||||||
|
|
||||||
|
RSpec.describe BulkUpload, type: :model do |
||||||
|
let(:bulk_upload) { create(:bulk_upload, log_type: "lettings") } |
||||||
|
|
||||||
|
describe "completed?" do |
||||||
|
context "when the fixed-choice has not been selected" do |
||||||
|
it "returns false" do |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
context "when there are incomplete logs" do |
||||||
|
let!(:lettings_log) { create_list(:lettings_log, 2,:in_progress, bulk_upload:) } |
||||||
|
|
||||||
|
it "returns false" do |
||||||
|
expect(bulk_upload.completed?).to equal(false) |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
context "when there are no incomplete logs" do |
||||||
|
let!(:lettings_log) { create_list(:lettings_log, 2, :completed, bulk_upload:) } |
||||||
|
|
||||||
|
it "returns true" do |
||||||
|
expect(bulk_upload.completed?).to equal(true) |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue