Sha256: e55cf11de2ace2e964a878631afceb529bcfd6a7f9a4a1e32f764a987664bf6c
Contents?: true
Size: 910 Bytes
Versions: 8
Compression:
Stored size: 910 Bytes
Contents
require 'spec_helper' class LikeSpec < MiniTest::Spec describe Recommendable::Like do before :each do @user = User.create(:username => "dave") end it "should not be created for an object that does not act_as_recommendedable" do cake = PhpFramework.create(:name => "CakePHP") proc { @user.like(cake) }.must_raise Recommendable::RecordNotRecommendableError end it "should be created for an object that does act_as_recommendable" do movie = Movie.create(:title => "2001: A Space Odyssey", :year => 1968) @user.like(movie).must_equal true end it "should not be created twice for the same user-object pair" do movie = Movie.create(:title => "2001: A Space Odyssey", :year => 1968) @user.like(movie).must_equal true @user.like(movie).must_be_nil Recommendable::Like.count.must_equal 1 end end end
Version data entries
8 entries across 8 versions & 1 rubygems