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
| Se | |
| 1 = 5 | |
| 2 = 25 | |
| 3 = 325 | |
| 4 = 4325 | |
| 5 = X | |
| Qual o valor de X? (faz um fork com a resposta ;D) |
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
| '''Aceitando requisições para a URL de validação com ou sem / no final (o manual indica *com*, mas atualmente só aceita sem)''' | |
| '''pagseguro.py:107''' | |
| if path.lower().rstrip('/')=='/security/npi/default.aspx': | |
| '''pagsegurotest.py:53''' | |
| def testNPIWithoutSlash(self): | |
| '''Testa se a confirmação do retorno automático (usando url sem /) vem como "VERIFICADO"''' | |
| retorno=pagseguro.process(retornoURL,dados) | |
| self.assertEquals('VERIFICADO',retorno) |
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
| # template.rb | |
| # from Anderson Dias | |
| #==================== | |
| # PLUGINS | |
| #==================== | |
| # Testing | |
| plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git' | |
| plugin 'cucumber', :git => 'git://github.com/aslakhellesoy/cucumber.git' |
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
| Feature: Sign Up | |
| In order to access the restricted areas of the site | |
| visitor | |
| wants to sign up and activate an account | |
| Scenario: Sign up | |
| When I signup as elomar, elomar@maisweb.org, Elomar França | |
| Then I should not be logged in | |
| And I should receive an email with subject "Please activate your new account" |
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 EventsController < ResourceController::Base | |
| before_filter :require_user, :except => [:index, :show] | |
| before_filter :require_organizer, :only => [:edit, :update, :destroy] | |
| create.before do | |
| object.organizer = current_user | |
| 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
| require File.dirname(__FILE__) + '/../spec_helper' | |
| describe Event do | |
| it { should belong_to(:organizer, :class_name => "User") } | |
| it { should have_many(:registrations) } | |
| it { should have_many(:users, :through => :registrations) } | |
| it { should have_many(:promocodes)} | |
| it { should validate_presence_of(:title, :location, :description, :start_at, :finish_at)} | |
| it { should validate_numericality_of(:price, :allow_nil => true)} |
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 'faker' | |
| Sham.name { Faker::Name.name } | |
| Sham.email { Faker::Internet.email } | |
| Sham.title { Faker::Lorem.sentence } | |
| Sham.body { Faker::Lorem.paragraph } | |
| User.blueprint do | |
| name | |
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
| Post.blueprint do | |
| title "Hello world" | |
| text "<p>Hello there</p>"*3 | |
| published_on Date.today | |
| author { User.make } | |
| end | |
| Comment.blueprint do | |
| author_name "Test name" | |
| author_email "unknown@maisweb.org" |
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
| post = Post.make | |
| post.new_record? # false | |
| post = Post.make_unsaved | |
| post.new_record? # true | |
| post.plan | |
| # { :title => "Lorem ipsum", :body => "Lorem ipsum dolor sit amet", ... } | |
| post = Post.make(:title => "Machinist FTW") |
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
| Comment.blueprint do | |
| author_name "Test name" | |
| author_email "unknown@maisweb.org" | |
| post | |
| end | |
| Comment.blueprint(:approved) do | |
| state :approved | |
| end |
OlderNewer