0

I have just started some system tests for my current application and I have now hit a roadblock.

test "visiting the timesheet index without signing in" do
  visit timesheets_path
  assert_text "You need to sign in or sign up before continuing.”
end

test "visiting the timesheet index (signing in first)" do
  visit new_user_session_path

  fill_in "Email address", with: "paul@contractor.com"
  fill_in "Password", with: "password"

  click_on "Log in"

  assert_text "Signed in successfully.”
end

The second test is failing due to not being able to load a font shown below:

Error: ContractorTimesheetsTest#test_visiting_the_timesheet_index_(signing_in_first): ActionController::RoutingError: No route matches [GET] "/fonts/fa-solid-900.woff2”

If I spin up my rails server locally I have no errors for missing resources and my font files are all loaded correctly.

For further reference, I am using the defaults for my application system test.

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
end

Does anyone have any suggestions on what I can do to fix the routing error?

Masoud Rahimi
  • 5,785
  • 15
  • 39
  • 67
  • How's your css file, where you are importing the problematic font? – Luan Gonçalves Barbosa May 09 '19 at 13:53
  • @LuanGonçalvesBarbosa sass with font-face, no issues when running it locally no errors and font icons are displayed correctly. `@font-face{font-family:Font Awesome\ 5 Free;font-style:normal;font-weight:900;font-display:auto;src:font-url('fa-solid-900.eot');src:font-url('fa-solid-900.eot?#iefix') format("embedded-opentype"),font-url('fa-solid-900.woff2') format("woff2"),font-url('fa-solid-900.woff') format("woff"),font-url('fa-solid-900.ttf') format("truetype"),font-url('fa-solid-900.svg#fontawesome') format("svg")}.fa,.far,.fas{font-family:Font Awesome\ 5 Free}.fa,.fas{font-weight:900}` – user2482671 May 09 '19 at 16:41

0 Answers0