Browse Source

feat: update tests

pull/2155/head
natdeanlewissoftwire 2 years ago
parent
commit
76e9d70607
  1. 3
      spec/components/document_list_component_spec.rb
  2. 2
      spec/helpers/collection_resources_helper_spec.rb
  3. 8
      spec/requests/start_controller_spec.rb

3
spec/components/document_list_component_spec.rb

@ -8,8 +8,9 @@ RSpec.describe DocumentListComponent, type: :component do
context "when rendering tabs" do context "when rendering tabs" do
it "all of the nav tabs specified in the items hash are passed to it" do it "all of the nav tabs specified in the items hash are passed to it" do
result = render_inline(described_class.new(items:)) result = render_inline(described_class.new(items:, label: "Label"))
expect(result.text).to include("Label")
expect(result.text).to include("PDF Form") expect(result.text).to include("PDF Form")
expect(result.text).to include("An important form") expect(result.text).to include("An important form")
expect(result.text).to include("4 pages") expect(result.text).to include("4 pages")

2
spec/helpers/collection_resources_helper_spec.rb

@ -7,7 +7,7 @@ RSpec.describe CollectionResourcesHelper do
describe "when displaying file metadata" do describe "when displaying file metadata" do
context "with pages" do context "with pages" do
it "returns correct metadata" do it "returns correct metadata" do
expect(file_type_size_and_pages("2023_24_lettings_paper_form.pdf", number_of_pages: 8)).to eq("PDF, 285 KB, 8 pages") expect(file_type_size_and_pages("2023_24_lettings_paper_form.pdf", number_of_pages: 8)).to eq("PDF, 286 KB, 8 pages")
end end
end end

8
spec/requests/start_controller_spec.rb

@ -39,8 +39,8 @@ RSpec.describe StartController, type: :request do
it "displays correct resources for 2022/23 and 2023/24 collection years" do it "displays correct resources for 2022/23 and 2023/24 collection years" do
get "/", headers: headers, params: {} get "/", headers: headers, params: {}
expect(page).to have_content("Lettings 2023/24") expect(page).to have_content("Lettings 23/24")
expect(page).to have_content("Sales 2023/24") expect(page).to have_content("Sales 23/24")
end end
end end
@ -51,8 +51,8 @@ RSpec.describe StartController, type: :request do
it "displays correct resources for 2022/23 and 2023/24 collection years" do it "displays correct resources for 2022/23 and 2023/24 collection years" do
get "/", headers: headers, params: {} get "/", headers: headers, params: {}
expect(page).not_to have_content("Lettings 2023/24") expect(page).not_to have_content("Lettings 23/24")
expect(page).not_to have_content("Sales 2023/24") expect(page).not_to have_content("Sales 23/24")
end end
end end

Loading…
Cancel
Save