Created
September 3, 2014 15:23
-
-
Save bezelga/102916bf4e463c9767e3 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
require 'spec_helper' | |
describe Tod do | |
describe '.add_task' do | |
let(:repo) { Tod.repo } | |
it 'adds a new task' do | |
expect { Tod.add_task('speak @ Guru-SP') }. | |
to change{ repo.count }.by(1) | |
end | |
context 'when title is blank' do | |
subject(:add_blank_task) { Tod.add_task('') } | |
it 'does not persist' do | |
expect { add_blank_task }.to_not change{ repo.count } | |
end | |
it { eq(false) } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment