Skip to content

Instantly share code, notes, and snippets.

@bezelga
Created September 3, 2014 15:23
Show Gist options
  • Save bezelga/102916bf4e463c9767e3 to your computer and use it in GitHub Desktop.
Save bezelga/102916bf4e463c9767e3 to your computer and use it in GitHub Desktop.
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