質問
Ruby on RailsでRSpecのテストで、エラーActionView::Template::Error: Error: Function hsla is missing argument $saturation
が出て落ちてしまいます。hsra関数で、saturation(彩度)の引数がないと言われているのですが、画面上は正常で原因が分かりません。
Failure/Error: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> ActionView::Template::Error: Error: Function hsla is missing argument $saturation. on line 435 of stdin >> background-color: hsla(var(--b1) / var(--tw-bg-opacity, 1)); --------------------^ [Screenshot Image]: /Users/madokatakanami/workspace/portfolio/tmp/screenshots/failures_r_spec_example_groups_restaurants_nested_nested_nested_6_nested_nested_2_飲食店の新規作成が失敗する_641.png # stdin:435 # ./app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb___1653758555336342047_21520' # ------------------ # --- Caused by: --- # SassC::SyntaxError: # Error: Function hsla is missing argument $saturation. # on line 435 of stdin # >> background-color: hsla(var(--b1) / var(--tw-bg-opacity, 1)); # # --------------------^ # stdin:435
↓記述したテスト
spec/system/restaurants_spec.rb
1 describe '飲食店の新規作成' do 2 context 'フォームの入力値が正常' do 3 it '飲食店の新規作成ができる' do 4 visit new_restaurant_path 5 fill_in 'rst_name', with: 'restaurant' 6 click_button '登録' 7 expect(page).to have_content('登録しました') 8 expect(Rstaurant.count).to eq 1 9 expect(current_path).to eq '/restaurants' 10 end 11 end
こちらを参考にしてrspecの環境構築をしました。
試したこと
画面の色は綺麗に出ています。
daisyUIを使用しているのですが、cssファイルにはsaturation
の文言は書いてありません。
エラーに関わるような検索結果が得られず、打つ手が分からないのでご助言頂きたいです。
よろしくお願いいたします!
補足情報(FW/ツールのバージョンなど)
使用:
ruby 3.1.2
rails 6.1.6
RSpec 3.12
daisyUI
Gemfileに追加したもの
1group :development, :test do 2 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 3 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 4 gem 'rspec-rails', '~> 6.0.0' 5 gem 'factory_bot_rails' 6end 7 8group :test do 9 gem 'capybara' 10 gem 'webdrivers' 11end
あなたの回答
tips
プレビュー