summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-09-24 21:59:55 -0600
committermo k <mo@mokhan.ca>2012-09-24 21:59:55 -0600
commit245ce693ea4d39b847eb50bd7fa32b5eedd73dac (patch)
treea8fa100099b851f415d6402bf95c5604cee501b8
parent6ec0a3b8b2c21ab11ef6a25bf434b71e032e806c (diff)
fix up the put specs
-rw-r--r--spec/controllers/creations_controller_spec.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/spec/controllers/creations_controller_spec.rb b/spec/controllers/creations_controller_spec.rb
index efa496e0..d31e6784 100644
--- a/spec/controllers/creations_controller_spec.rb
+++ b/spec/controllers/creations_controller_spec.rb
@@ -78,23 +78,15 @@ describe CreationsController do
describe "PUT update" do
describe "with valid params" do
- it "updates the requested creation" do
- user.stub(:creations){ mock_creation }
- mock_creation.should_receive(:update_attributes).with({'these' => 'params', 'category_ids' => []})
- put :update, :id => "37", :creation => {'these' => 'params'}
+ before :each do
+ put :update, :id => creation.id, :creation => {:name => 'params'}
end
-
it "assigns the requested creation as @creation" do
- creation = mock_creation(:update_attributes => true, :category_ids => [])
- user.stub(:creations){ creation }
- put :update, :id => "1", :creation => { :category_ids => [] }
- assigns(:creation).should be(creation)
+ assigns(:creation).should eq(creation)
end
it "redirects to the creation" do
- user.stub(:creations){ mock_creation(:update_attributes => true) }
- put :update, :id => "1", :creation => { :category_ids => [] }
- response.should redirect_to(creation_url(mock_creation))
+ response.should redirect_to("/creations/#{creation.id}-params")
end
end