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
## | |
# test/spec/mini 5 | |
# http://gist.github.com/307649 | |
# [email protected] | |
# | |
def context(*args, &block) | |
return super unless (name = args.first) && block | |
require 'test/unit' | |
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do | |
def self.test(name, &block) |
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
#! /usr/bin/env ruby | |
=begin | |
backshot.rb is a Ruby program driving | |
Amazon EBS <http://aws.amazon.com/ebs/> | |
to generate snapshots for backup purposes. | |
Hourly, daily, weekly, and monthly snapshots | |
are generated by default. |
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
require 'test_helper' | |
class ProductsIntegrationTest < ActionController::IntegrationTest | |
test "browse product page" do | |
product = Factory.create(:product) | |
visit product_path(product) | |
within(:css, ".products.show .product") do | |
assert_content "Textmate", "h3 a" |
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
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" end | |
def underline n; escape "4;#{n}" end | |
def escape n; "\033[#{n}m" if STDOUT.tty? end | |
end |
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! |
NewerOlder