我有一个方法:
class Match
def self.get_common_interests(user1, user2)
user1.interests & user2.interests
end
end
测试:
describe Match do
let(:fred) { FactoryGirl.build(:user, interests: ["Rails", "Fishing"]}
let(:barney) { FactoryGirl.build(:user, interests: ["Rails"]}
describe "interests" do
it "should return common interests array if users have something in common" do
common = Match.get_common_interests(fred, barney)
common.should be_an_instance_of(Array)
common.should == ["Rails"]
end
end
我已升级到rspec-rails 2.8.1,现在这个规范中的所有其他方法都失败了。
知道为什么吗?