Created
April 13, 2011 18:58
-
-
Save heronmedeiros/918153 to your computer and use it in GitHub Desktop.
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
#ap/model/bunch.rb | |
def excisable? | |
created_at <= 12.weeks.ago | |
end | |
#bunch_spec.rb | |
require 'spec_helper' | |
describe Bunch do | |
before(:each) do | |
@bunch = Factory.build(:bunch) | |
end | |
context 'verificar a quantidade prevista de cachos' do | |
# Como usuario quero verificar a quantidade prevista de cachos a colher na semana | |
# recebe o dia e com base na semana procura todos os cachos previstos pra colheita. | |
# Os cachos lançados numa determinada semana deverão ser colhidos após 10 a 12 semanas aproximadamente. | |
it 'Cachos que podem ser colhidos' do | |
@bunch = Factory(:bunch, :created_at => 12.weeks.ago) | |
@bunch.should be_excisable | |
end | |
it 'Um novo cacho nao pode ser colhidos' do | |
@bunch = Factory(:bunch, :created_at => Time.now) | |
@bunch.should_not be_excisable | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment