LoginSignup
2
1

More than 5 years have passed since last update.

capybara + poltergeistで「marshal data too short」エラー

Last updated at Posted at 2015-01-15

背景

capybara + poltergeistでフィーチャーテストを書いた

※下の記事を参考にしました
http://qiita.com/jnchito/items/bdd80c1085fa082e7d7a

現象

テストが通らない...

Failure/Error: expect(page).to have_content 'user[pref]'

何でや!

調査

HTML見てみよう...

feature 'User pages' do
  scenario 'select hoge', js: true do

    visit new_user_path

+   File.write("page.html",  page.html)

    (略)
  end
end
$ vim page.html

ややっHTMLがエラー画面ではありませんか

(消してしまいました)

変なエラー出てる...

ActionView::Template::Error:
     marshal data too short

どうすりゃええんや

解決

$ rake tmp:clear

$ bundle exec rspec -fd spec/features

直った

1 example, 0 failures  

原因

tmp/sessionsに変な(大きすぎる?)データがあったっぽい(証拠が残っていません...)

参考

`marshal data too short` error when executing a capybara test using poltergeist a few times

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1