Rspec 2.8.1打破了我的规格

时间:2012-01-09 01:43:28

标签: ruby-on-rails-3 unit-testing rspec2 rspec-rails

我有一个方法:

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,现在这个规范中的所有其他方法都失败了。

知道为什么吗?

0 个答案:

没有答案