@ -22,11 +22,14 @@ RSpec.describe "Bulk upload lettings log" do
# rubocop:disable RSpec/AnyInstance
# rubocop:disable RSpec/AnyInstance
context " when during crossover period " do
context " when during crossover period " do
before do
before do
allow ( FeatureToggle ) . to receive ( :force_crossover? ) . and_return ( true )
Timecop . freeze ( 2023 , 6 , 1 )
end
after do
Timecop . return
end
end
it " shows journey with year option " do
it " shows journey with year option " do
Timecop . freeze ( 2023 , 6 , 1 ) do
visit ( " /lettings-logs " )
visit ( " /lettings-logs " )
expect ( page ) . to have_link ( " Upload lettings logs in bulk " )
expect ( page ) . to have_link ( " Upload lettings logs in bulk " )
click_link ( " Upload lettings logs in bulk " )
click_link ( " Upload lettings logs in bulk " )
@ -72,12 +75,18 @@ RSpec.describe "Bulk upload lettings log" do
expect ( page ) . to have_content ( " Upload lettings logs in bulk " )
expect ( page ) . to have_content ( " Upload lettings logs in bulk " )
end
end
end
end
end
# rubocop:enable RSpec/AnyInstance
# rubocop:enable RSpec/AnyInstance
context " when not it crossover period " do
context " when not it crossover period " do
before do
Timecop . freeze ( 2024 , 1 , 1 )
end
after do
Timecop . return
end
it " shows journey with year option " do
it " shows journey with year option " do
Timecop . freeze ( 2024 , 1 , 1 ) do
visit ( " /lettings-logs " )
visit ( " /lettings-logs " )
expect ( page ) . to have_link ( " Upload lettings logs in bulk " )
expect ( page ) . to have_link ( " Upload lettings logs in bulk " )
click_link ( " Upload lettings logs in bulk " )
click_link ( " Upload lettings logs in bulk " )
@ -88,11 +97,17 @@ RSpec.describe "Bulk upload lettings log" do
expect ( page ) . to have_content ( " Upload your file " )
expect ( page ) . to have_content ( " Upload your file " )
end
end
end
end
end
context " when the collection year isn't 22/23 " do
context " when the collection year isn't 22/23 " do
before do
Timecop . freeze ( 2024 , 1 , 1 )
end
after do
Timecop . return
end
it " shows journey without the needstype " do
it " shows journey without the needstype " do
Timecop . freeze ( 2024 , 1 , 1 ) do
visit ( " /lettings-logs " )
visit ( " /lettings-logs " )
expect ( page ) . to have_link ( " Upload lettings logs in bulk " )
expect ( page ) . to have_link ( " Upload lettings logs in bulk " )
click_link ( " Upload lettings logs in bulk " )
click_link ( " Upload lettings logs in bulk " )
@ -111,5 +126,4 @@ RSpec.describe "Bulk upload lettings log" do
click_button ( " Upload " )
click_button ( " Upload " )
end
end
end
end
end
end
end