From edde4bef75b31310ea0a6fe839ab0d5fa17ab7b2 Mon Sep 17 00:00:00 2001 From: Ken Lu Date: Sun, 26 May 2013 08:16:30 -0400 Subject: [PATCH] remove the like controller spec Fixed #11 --- spec/controllers/likes_controller_spec.rb | 29 ----------------------- 1 file changed, 29 deletions(-) delete mode 100644 spec/controllers/likes_controller_spec.rb diff --git a/spec/controllers/likes_controller_spec.rb b/spec/controllers/likes_controller_spec.rb deleted file mode 100644 index fdd27ef..0000000 --- a/spec/controllers/likes_controller_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'spec_helper' - -describe LikesController do - let(:usr1) { create :member_user } - let!(:usr) { create :member_user } - let!(:book) { create :book, user: usr} - before(:each) do - request.env["HTTP_REFERER"] = root_path - usr1.like! book - sign_in usr - end - #before {controller.stub!(:current_user).and_return(usr)} - context "post#create" do - it "should create link" do - expect do - post :create, {resource_name: 'Book', resource_id: book.id} - end.to change{Book.find(book.id).like_count}.by(1) - end - end - - context "delete#destroy" do - it "destroy the current user like" do - usr.like! book - expect do - delete :destroy, { resource_name: 'Book', resource_id: book.id } - end.to change { Book.find(book.id).like_count }.by(-1) - end - end -end \ No newline at end of file