* test to download only search results
* testing I can download only logs matching both search and filter
* rubocop
* matching style for title
* ILIKE for search
* rubocop
* using ILIKE
* upated rack due to vulnerability
* refactoring
* refactoring
* refactored test
* refactored matching search results on multiple page tests for title
* no pagination title
* no pagination title for when no logs
* fixed all title related tests for filter and search
* rubocop
* removing extra space in the view - unneccesary
* better test when searching for postcode
* failing lint?
* refactored condition
* refactored content to links
* refactored content to links in case logs
<% title = "Logs (search results for ‘#{@searched}’#{@pagy.last > 1 ? ", page #{@pagy.page} of #{@pagy.last}" : ''}) - Submit social housing and sales data (CORE) - GOV.UK" %>
<% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %>
<% else %>
<% title = "Logs #{@pagy.last > 1 ? "(page #{@pagy.page} of #{@pagy.last}) " : ''}- Submit social housing and sales data (CORE) - GOV.UK" %>
<% title = "Logs (search results for ‘#{@searched}’#{@pagy.last > 1 ? ", page #{@pagy.page} of #{@pagy.last}" : ''}) - Submit social housing and sales data (CORE) - GOV.UK" %>
<% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %>
<% else %>
<% title = "Logs #{@pagy.last > 1 ? "(page #{@pagy.page} of #{@pagy.last}) " : ''}- Submit social housing and sales data (CORE) - GOV.UK" %>
expect(page).tohave_content("Logs (search results for ‘#{log_to_search.id}’) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (1 log matching ‘#{log_to_search.id}’ of #{log_total_count} total logs) - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).tohave_content("Logs (search results for ‘#{logs[0].postcode_full}’, page 1 of 2) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (#{logs.count} logs matching ‘#{postcode}’ of #{log_total_count} total logs) (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
it"has title with pagination details for page 2"do
expect(page).tohave_content("Logs (search results for ‘#{logs[0].postcode_full}’, page 2 of 2) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (#{logs.count} logs matching ‘#{postcode}’ of #{log_total_count} total logs) (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
@ -463,7 +466,7 @@ RSpec.describe CaseLogsController, type: :request do
end
it"does not have pagination in the title"do
expect(page).tohave_title("Logs - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (Logs) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
it"shows the download csv link"do
@ -539,7 +542,7 @@ RSpec.describe CaseLogsController, type: :request do
end
it"has pagination in the title"do
expect(page).tohave_title("Logs (page 1 of 2) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (Logs) (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
@ -564,7 +567,7 @@ RSpec.describe CaseLogsController, type: :request do
end
it"has pagination in the title"do
expect(page).tohave_title("Logs (page 2 of 2) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (Logs) (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
end
@ -753,6 +756,27 @@ RSpec.describe CaseLogsController, type: :request do
expect(page).tohave_content("Logs (search results for ‘#{log_to_search.id}’) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (1 log matching ‘#{log_to_search.id}’ of #{log_total_count} total logs) - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).tohave_content("Logs (search results for ‘#{logs[0].postcode_full}’, page 1 of 2) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (#{logs.count} logs matching ‘#{postcode}’ of #{log_total_count} total logs) (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
it"has title with pagination details for page 2"do
expect(page).tohave_content("Logs (search results for ‘#{logs[0].postcode_full}’, page 2 of 2) - Submit social housing and sales data (CORE) - GOV.UK")
expect(page).tohave_title("Your organisation (#{logs.count} logs matching ‘#{postcode}’ of #{log_total_count} total logs) (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
@ -476,9 +479,9 @@ RSpec.describe OrganisationsController, type: :request do