|
|
|
|
@ -590,6 +590,7 @@ RSpec.describe DuplicateLogsController, type: :request do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "viewing the page" do |
|
|
|
|
context "when there are duplicate logs" do |
|
|
|
|
before do |
|
|
|
|
get organisation_duplicates_path(organisation_id: user.organisation_id) |
|
|
|
|
end |
|
|
|
|
@ -616,6 +617,25 @@ RSpec.describe DuplicateLogsController, type: :request do
|
|
|
|
|
expect(page).to have_link("Review logs", href: sales_log_duplicate_logs_path(11, original_log_id: 11, organisation_id: user.organisation_id)) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when there are no duplicate logs" do |
|
|
|
|
before do |
|
|
|
|
allow(Organisation).to receive(:find).with(user.organisation_id.to_s).and_return(user.organisation) |
|
|
|
|
allow(user.organisation).to receive(:duplicate_lettings_logs_sets).and_return([]) |
|
|
|
|
allow(user.organisation).to receive(:duplicate_sales_logs_sets).and_return([]) |
|
|
|
|
get organisation_duplicates_path(organisation_id: user.organisation_id) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct headers" do |
|
|
|
|
expect(page).to have_content("There are no more duplicate logs") |
|
|
|
|
expect(page).to have_content("You have either changed or deleted all the duplicate logs.") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "shows back to all logs button" do |
|
|
|
|
expect(page).to have_link("Back to all logs", href: lettings_logs_path) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when the user is a data coordinator" do |
|
|
|
|
@ -648,6 +668,7 @@ RSpec.describe DuplicateLogsController, type: :request do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "viewing the page" do |
|
|
|
|
context "when there are duplicate logs" do |
|
|
|
|
before do |
|
|
|
|
get duplicate_logs_path |
|
|
|
|
end |
|
|
|
|
@ -674,6 +695,24 @@ RSpec.describe DuplicateLogsController, type: :request do
|
|
|
|
|
expect(page).to have_link("Review logs", href: sales_log_duplicate_logs_path(11, original_log_id: 11)) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when there are no duplicate logs" do |
|
|
|
|
before do |
|
|
|
|
allow(user).to receive(:duplicate_lettings_logs_sets).and_return([]) |
|
|
|
|
allow(user).to receive(:duplicate_sales_logs_sets).and_return([]) |
|
|
|
|
get duplicate_logs_path |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct headers" do |
|
|
|
|
expect(page).to have_content("There are no more duplicate logs") |
|
|
|
|
expect(page).to have_content("You have either changed or deleted all the duplicate logs.") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "shows back to all logs button" do |
|
|
|
|
expect(page).to have_link("Back to all logs", href: lettings_logs_path) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|