spec/models/bookmark_spec.rb in blacklight-4.7.0 vs spec/models/bookmark_spec.rb in blacklight-4.8.0

- old
+ new

@@ -3,29 +3,30 @@ describe Bookmark do before(:each) do @bookmark = Bookmark.new end - + it "should be valid" do @bookmark.id = 1 @bookmark.user_id = 1 @bookmark.document_id = 'u001' - @bookmark.should be_valid + expect(@bookmark).to be_valid end - + it "should require user_id" do - @bookmark.should have(1).error_on(:user_id) + expect(@bookmark).not_to be_valid + expect(@bookmark.errors[:user_id].length).to eq 1 end it "should belong to user" do - Bookmark.reflect_on_association(:user).should_not be_nil + expect(Bookmark.reflect_on_association(:user)).not_to be_nil end it "should be valid after saving" do @bookmark.id = 1 @bookmark.user_id = 1 @bookmark.document_id = 'u001' @bookmark.save - @bookmark.should be_valid + expect(@bookmark).to be_valid end end