Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global alias.co checkout
git config --global apply.whitespace nowarn
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global alias.co checkout
git config --global apply.whitespace nowarn
describe Invoice do | |
subject { described_class.new(user: user, items: items) } | |
let(:user) { FactoryGirl.create(:user) } | |
let(:items) { 2.times.map { FactoryGirl.create(:item, price: 100) } } | |
describe '#sales_tax' do | |
it 'charges sales tax when the user is in CA' do | |
user.state = 'CA' | |
expect(subject.sales_tax).to eq(200 * 0.0875) | |
end |
describe Invoice do | |
subject { described_class.new(user: user, items: items) } | |
let(:user) { FactoryGirl.create(:user) } | |
let(:items) { 2.times.map { FactoryGirl.create(:item, price: 100) } } | |
describe '#sales_tax' do | |
it 'charges sales tax when the user is in CA' do | |
user.state = 'CA' | |
invoice.finalize! | |
expect(subject.sales_tax).to eq(200 * 0.0875) |
module RSpec | |
module Core | |
module MemoizedHelpers | |
module ClassMethods | |
alias_method :expected, :let | |
end | |
end | |
end | |
end |
describe Invoice do | |
subject { described_class.new(user: user, items: items) } | |
let(:user) { FactoryGirl.create(:user, state: state) } | |
let(:items) { 2.times.map { FactoryGirl.create(:item, price: 100) } } | |
let(:state) { 'NY' } | |
describe '#sales_tax' do | |
context 'in CA' do | |
let(:state) { 'CA' } |
describe Invoice do | |
subject { described_class.new(user: user, items: items) } | |
let(:user) { FactoryGirl.create(:user, state: state) } | |
let(:items) { 2.times.map { FactoryGirl.create(:item, price: 100) } } | |
let(:state) { 'NY' } | |
describe '#sales_tax' do | |
shared_examples_for 'calculates sales tax' do | |
it 'calculates sales tax' do | |
invoice.finalize! |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |