Skip to content

Instantly share code, notes, and snippets.

@joeljackson
Last active August 29, 2015 14:20
Show Gist options
  • Save joeljackson/be9e39544a85f7cc2a78 to your computer and use it in GitHub Desktop.
Save joeljackson/be9e39544a85f7cc2a78 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Scheduled::ChaseCardUpdateRequestJob do
describe "#execute" do
before do
orders
Scheduled::ChaseCardUpdateRequestJob.new.execute
end
memoized_context "Order being shipped in the next 10 days that needs an updated card" do
let(:orders){
[
FactoryGirl.create(:order, :ships_in_two_business_days, :essentials_bundle, :with_chase)
]
}
testing_group "First order's credit_card" do
subject { orders.first.credit_card }
its("transactions.length"){ should eq 1 }
end
testing_group "First order's credit_card's first transction" do
subject { orders.first.credit_card.transactions.first }
it { should be }
its(:human_readable_type) { should eq :account_updater }
its(:status) { should eq :marked }
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment