This file contains 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 | |
snippet |
This file contains 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
Sorter::DiligenceSearch testing the entire stack should return all search results sorted | |
Failure/Error: sorter.sort.should == [SearchIndex.first] | |
expected: [#<SearchIndex id: 60, city_hall_id: nil, institution_id: nil, searchable_id: 51, searchable_type: "City", name: "city", model_weight: 1, rank_a: "sao paulo", rank_b: "sp", rank_c: nil, created_at: "2013-02-06 16:53:17", updated_at: "2013-02-06 16:53:17", active: nil, branch_id: nil>] | |
got: [#<SearchIndex id: 72, city_hall_id: 1, institution_id: 1, searchable_id: 1, searchable_type: "Diligence", name: "diligencia", model_weight: 1, rank_a: "1 00000001 guia g 00000001 10/2011 nao recolhimento...", rank_b: "filial centro 74215432000318 74.215.432/0003-18 000...", rank_c: "problema de pagamento de guia", created_at: "2013-02-06 16:54:02", updated_at: "2013-02-06 16:54:02", active: true, branch_id: 1>] (using ==) | |
Diff: | |
@@ -1,2 +1,2 @@ | |
-[#<SearchIndex id: 60, city_hall_id: nil, institution_id: nil, searchable_id: 51, |
This file contains 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
Associations | |
should belong to diligence (FAILED - 1) | |
should belong to issqn_monthly_survey (FAILED - 2) | |
should have many fiscal_action_problems (FAILED - 3) | |
should have many fiscal_actions (FAILED - 4) | |
Validations | |
Failures: | |
1) ProblemIssqnMonthlySurvey Validations |
This file contains 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
# model/order.rb | |
class Order | |
def items_format_type | |
items.group_by{ |order_item| order_item.item.format.type }.keys | |
end | |
end | |
# lib/order_resource.rb | |
class OrderResource | |
This file contains 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 OrdersController < ApplicationController | |
def confirm | |
order = OrderResource.confirm(params) | |
redirect_to payment_on_external_service_url(order.number) | |
end | |
end | |
class Order | |
def final_message | |
if items.any?{ |item| item == :paper } |
This file contains 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
#http://eggsonbread.com/2010/03/28/my-rspec-best-practices-and-tips/ | |
describe User do | |
subject { user } | |
let(:user) { User.new } | |
context "when name empty" do | |
it { should_not be_valid } | |
specify { user.save.should be_false } | |
end |
This file contains 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
# language: pt | |
# features/poker.feature | |
Funcionalidade: Detectar jogada de Poker | |
Para jogar poker | |
E com um baralho com um naipe apenas | |
Como um jogador | |
Eu quero ver as possíveis combinações | |
Cenario: Royal flush |
This file contains 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
# lib/game.rb | |
class Game | |
def initialize() | |
@royal_flush = %w(dez valete dama reis as) | |
@straight_flush = %w(quatro cinco seis sete oito) | |
end | |
def cards(*card) |
This file contains 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
# language: pt | |
# features/dicionario.feature | |
# @author Marco Moura <email at marcomoura.com> | |
# @author Luciana Mendes <super.luci at gmail.com> | |
# @author Rafael Salomao <rafaelgavazzi at gmail.com> | |
# @author Patricia Carvalho <patfcarv at gmail.com> | |
# @author Carlos Eduardo <kaddxxi at gmail.com> | |
Funcionalidade: Dicionary Replace |
This file contains 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
#@author Rafael Salomao <rafaelgavazzi at gmail.com> | |
#@author Natalia Marcondes < natalia.marcondes at gmail.com> | |
#@author Marco Moura <email at marcomoura.com> | |
#@author Luciana Mendes <super.luci at gmail.com> | |
#@author Carlos Eduardo <kaddxxi at gmail.com> | |
#@author Patricia Carvalho <patfcarv at gmail.com> | |
class Dinostratus: | |
@staticmethod |
NewerOlder