Created
May 19, 2010 13:28
-
-
Save lukaszx0/406300 to your computer and use it in GitHub Desktop.
Ticket estimated to 2h done in 2 minutes by changing 2 lines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/controllers/ads_controller.rb b/app/controllers/ads_controller.rb | |
index fa42e94..19ea145 100644 | |
--- a/app/controllers/ads_controller.rb | |
+++ b/app/controllers/ads_controller.rb | |
@@ -92,6 +92,7 @@ class AdsController < ApplicationController | |
def update | |
@ad.attributes = params[:ad] | |
@ad.attach_images(params[:ad_images_ids]) if(params[:ad_images_ids]) | |
+ @ad.checked = false | |
@ad.save! | |
flash[:notice] = "Ad was successfully updated." | |
redirect_to(ad_path(@ad)) | |
diff --git a/spec/controllers/ads_controller_spec.rb b/spec/controllers/ads_controller_spec.rb | |
index cfdaaa0..64ec60e 100644 | |
--- a/spec/controllers/ads_controller_spec.rb | |
+++ b/spec/controllers/ads_controller_spec.rb | |
@@ -197,6 +197,7 @@ describe(AdsController)do | |
response.should(be_redirect) | |
response.should(redirect_to(ad_path(@ad))) | |
assigns[:ad].should(equal(@ad)) | |
+ assigns[:ad].checked.should == false | |
end | |
end | |
describe("with invalid data") do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment