Browse Source
# Context - https://digital.dclg.gov.uk/jira/browse/CLDC-2361 - When fixing inline for sales bulk uploads users need to be able to show only logs related to the bulk upload therefore have the bulk upload filter applied # Changes - After a sales bulk upload the session is set with bulk upload filter - When viewing sales log ensure we extract this apply as a filter # Issues - The current implementation is globally shared between lettings and sales therefore there are issues when switching between the 2 areas - There is a backlog ticket to refactor the filter and recommend fixing this issue thenpull/1630/head
Phil Lee
2 years ago
committed by
GitHub
3 changed files with 48 additions and 1 deletions
@ -0,0 +1,33 @@
|
||||
require "rails_helper" |
||||
|
||||
RSpec.describe SalesLogsController do |
||||
let(:bulk_upload) { create(:bulk_upload, :sales) } |
||||
|
||||
before do |
||||
sign_in bulk_upload.user |
||||
end |
||||
|
||||
describe "#index" do |
||||
context "when a sales bulk upload has been resolved" do |
||||
it "redirects to resume_bulk_upload_sales_result_path" do |
||||
session[:logs_filters] = { bulk_upload_id: [bulk_upload.id.to_s] }.to_json |
||||
|
||||
get :index |
||||
|
||||
expect(response).to redirect_to("/sales-logs/bulk-upload-results/#{bulk_upload.id}/resume") |
||||
end |
||||
end |
||||
|
||||
context "when a resolved lettings bulk upload filter applied" do |
||||
let(:bulk_upload) { create(:bulk_upload, :lettings) } |
||||
|
||||
it "does not redirect to resume" do |
||||
session[:logs_filters] = { bulk_upload_id: [bulk_upload.id.to_s] }.to_json |
||||
|
||||
get :index |
||||
|
||||
expect(response).not_to redirect_to("/sales-logs/bulk-upload-results/#{bulk_upload.id}/resume") |
||||
end |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue