5

単純な機能仕様で JavaScript を使用しようとしていますが、ページにアクセスすることさえできません。

describe "DiskFiles" do
  ...
  describe "update action", js: true do
    before(:each) do
      df = FactoryGirl.create(:disk_file)
      visit edit_disk_file_path(df)
    end

    it "should not show checkmark if no match" do
      expect(page).to_not have_content "✓"
    end
  end
end

次のエラーが表示されます。

  1) DiskFiles update action should not show checkmark if no match
     Failure/Error: Unable to find matching line from backtrace
     ActiveRecord::RecordNotFound:
       Couldn't find DiskFile with id=7598 [WHERE "disk_items"."type" IN ('DiskFile')]
     # ./app/controllers/disk_files_controller.rb:89:in `set_disk_file'

before(:each) でそのレコードを作成したばかりで、削除すると合格するため、混乱しますjs: true

私は何が欠けていますか?

4

1 に答える 1