Commit 03c83076

luuduong <luuduong@gmail.com>
2013-09-14 14:41:02
create failing feature spec to add a cake to the favorites.
1 parent cfd6592
Changed files (1)
spec/features/add_to_favorites_spec.rb
@@ -0,0 +1,21 @@
+require "spec_helper"
+
+describe "adding a cake to your favorites", :js => true do
+  let!(:creation) { create(:creation, user: create(:user), photos: [create(:photo)]) }
+  let!(:me) { create(:user, :password => "password") }
+
+  before :each do
+    visit user_session_path
+    within('.form-inline') do
+      fill_in('user_email', :with => me.email)
+      fill_in('user_password', :with => "password")
+    end
+    click_button("Sign In")
+    click_link(creation.name)
+    click_button("ADD TO FAVORITES")
+  end
+
+  it "should redirect you to the cake after" do 
+    page.should have_content("Welcome to the fanclub!")
+  end
+end
\ No newline at end of file