-1
在index
方法中有2個數組,我想測試數組的長度是否相等,但它不工作(手動測試後數組長度相等)`rspec` - 比較兩個陣列的長度相互之間的差異
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