-1
index
メソッドで2つの配列を持つが、配列の長さの等価性をテストしたいが、動作しない(配列の長さは手動でテストした後に等しい)`rspec` - 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