开发者

Getting "undefined method" error on form select in cucumber

开发者 https://www.devze.com 2022-12-27 15:30 出处:网络
I\'m trying to visit a page with cucumber, with: visit new_video_path but I get this error: undefined method `开发者_JAVA百科episode_id\' for #<Video:0x22df8dc> (ActionView::TemplateError)

I'm trying to visit a page with cucumber, with:

visit new_video_path

but I get this error:

undefined method `开发者_JAVA百科episode_id' for #<Video:0x22df8dc> (ActionView::TemplateError)
On line #19 of app/views/videos/_form.html.erb
...
19:     <%= select(:video, :episode_id, @episodes.collect {|e| [ e.title, e.id ] }, { :include_blank => true }) %>

It loads fine in the browser, and the form processes fine too.

What did I do wrong?


Ah, found the problem. I forgot to migrate the test database.

rake db:migrate RAILS_ENV=test
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号