Skip to content

Instantly share code, notes, and snippets.

View diegorv's full-sized avatar

Diego Rossini diegorv

View GitHub Profile
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe EmployeeAddress do
before(:each) do
@valid_attributes_employee = {
:name => "value for name",
:cpf => "value for cpf",
:rg => "value for rg",
:company_entry => Time.now,
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe EmployeesController do
describe "route generation" do
it "maps #index" do
route_for(:controller => "employees", :action => "index").should == "/employees"
end
it "maps #new" do
route_for(:controller => "employees", :action => "new").should == "/employees/new"
class ConfigStore
attr_reader :file
def initialize(file)
@file = file
end
def load
@config ||= YAML::load(open(file))
self
<html>
<head>
<title></title>
<META NAME="DESCRIPTION" CONTENT="">
<META NAME="KEYWORDS" CONTENT="">
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var total1 = 0;
def total_sold
self.prospects.map{ |prospect| @qt =+ 1 if prospect.status == "sold" }
@qt
end
set :application, "myapp"
set :keep_releases, 5
# git options
set :scm, "git"
set :repository, "git://github.com/georgeguimaraes/myapp.git"
set :branch, "master"
set :deploy_via, :remote_cache
# deploy credentials
named_scope :estado, lambda { |estado|
return {} unless estado != "todos_estados"
{ :conditions => ["anuncios.estado = ?", estado] }
}
Spork.prefork do
# IMPORTANT: This file was generated by Cucumber 0.4.2
# Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.
# Consider adding your own code to a new file instead of editing this one.
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails/world'
mysql> EXPLAIN SELECT anuncios.codcli,
-> anuncios.razsocial,
-> anuncios.nomefanta,
-> anuncios.irmao,
-> anuncios.endereco,
-> anuncios.num,
-> anuncios.complemento,
-> anuncios.bairro,
-> anuncios.cidade,
-> anuncios.uf,
module PagseguroHelper
def pagseguro_form(order)
content_tag(:form, :id => "pagseguro", :target => 'pagseguro', :method => 'post', :action => 'https://pagseguro.uol.com.br/security/webpagamentos/webpagto.aspx') do
result = ""
result << hidden_field_tag(:email_cobranca, 'seu@email.com')
result << hidden_field_tag(:tipo, 'CP') # Chumbado
result << hidden_field_tag(:moeda, 'BRL') # Chumbado
result << hidden_field_tag(:ref_transacao, order.id)
result << hidden_field_tag(:encoding, 'utf-8')
result << hidden_field_tag(:tipo_frete, 'SD') # Sedex - pro pagseguro calcular o frete automagicamente