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
| [ | |
| {:name => 'BronzeBusiness' , | |
| :url => 'http://www.bronzebusiness.com.br/webservices/wscep.asmx/cep?strcep=', | |
| :fields => %w(logradouro nome bairro UF cidade) | |
| }, | |
| {:name => 'RepublicaVirtual' , | |
| :url => 'http://cep.republicavirtual.com.br/web_cep.php?cep=', | |
| :fields => %w(tipo_logradouro logradouro bairro uf cidade) | |
| }, | |
| {:name => 'Paicon' , |
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 'simplecov' | |
| #SimpleCov.start 'rails' | |
| require 'rubygems' | |
| #require 'spork' | |
| #Spork.prefork do | |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path("../../config/environment", __FILE__) | |
| require 'rspec/rails' |
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
| class Client < ActiveRecord::Base | |
| has_many :client_companies, :dependent => :destroy | |
| has_many :contracts , :dependent => :destroy | |
| accepts_nested_attributes_for :client_companies , :allow_destroy => true | |
| end | |
| class ClientCompany < ActiveRecord::Base | |
| belongs_to :client | |
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 Shoulda # :nodoc: | |
| module ActiveRecord # :nodoc: | |
| # Examples: | |
| # class Book < ActiveRecord::Base | |
| # named_scope :test, :conditions => { :name => "test" } | |
| # named_scope :by_name, lambda { |n| { :conditions => { :name => n} } } | |
| # end | |
| # | |
| # RSpec: |
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
| RSpec::Matchers.define :allow do |*values| | |
| match do |record| | |
| values.collect {|value| | |
| record.send("#{@attribute}=", value) | |
| record.valid? | |
| record.errors[@attribute].empty? | |
| }.all? | |
| end | |
| chain :as do |attribute| |
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
| # bash_completion - programmable completion functions for bash 3.x | |
| # (backwards compatible with bash 2.05b) | |
| # | |
| # $Id: bash_completion,v 1.872 2006/03/01 16:20:18 ianmacd Exp $ | |
| # | |
| # Copyright (C) Ian Macdonald <[email protected]> | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 2, or (at your option) |
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
| $ cucumber --backtrace --verbose --tags @bank_account | |
| Using the default profile... | |
| Code: | |
| * features/support/env.rb | |
| * features/support/paths.rb | |
| * features/step_definitions/base_steps.rb | |
| * features/step_definitions/web_steps.rb | |
| * features/step_definitions/web_steps_pt-br.rb | |
| Features: |
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
| $ cucumber --backtrace --verbose --tags @bank_accountUsing the default profile... | |
| Code: | |
| * features/support/env.rb | |
| * features/support/paths.rb | |
| * features/step_definitions/base_steps.rb | |
| * features/step_definitions/web_steps.rb | |
| * features/step_definitions/web_steps_pt-br.rb | |
| Features: | |
| * features/admin/admin_bank_accounts.feature |
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
| source 'http://rubygems.org' | |
| gem 'rails', '3.0.0.rc' | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| # ----------------------------------------------------------------------- # | |
| # Default | |
| gem 'inherited_resources', '1.1.2' | |
| gem 'will_paginate', "~> 3.0.pre2" |
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
| class RoleSets | |
| role :admin do | |
| can :manage, :all | |
| end | |
| role :diretoria do | |
| can [:read, :edit], [Post] | |
| end | |
| role :maluco do |