【发布时间】:2016-07-26 01:21:05
【问题描述】:
index 方法中有 2 个数组,我想测试数组长度的相等性,但它不起作用(手动测试后数组的长度相等)
def index
@countries = get_countries()
@capitals = get_capitals()
end
Rspec 文件:
describe CountriesController do
describe 'index' do
it 'countries.length == capitals.length' do
expect(assigns(countries.length)).to eq (assigns(capitals.length))
end
end
end
【问题讨论】:
标签: ruby-on-rails rspec