【发布时间】:2015-03-30 03:39:58
【问题描述】:
我有下一个规格:
click_link('Edit')
expect(current_path).to eq(edit_news_path(@news))
fill_in('Body', with: 'Changed body')
click_button('Edit')
expect(current_path).to eq(admin_path)
expect(@news.body).to eq('Changed body')
所有期望都通过了测试,但不是fill_in期望:
Failure/Error: expect(@news.body).to eq('Changed body')
expected: "Changed body"
got: "Example"
(compared using ==)
现场一切正常,所有编辑都保存了,那么 rspecs 中的问题是什么?
【问题讨论】: