Skip to content

Instantly share code, notes, and snippets.

@libbyschuknight
Created January 12, 2018 01:34
Show Gist options
  • Save libbyschuknight/02e502d00a424f0344c22c8aacdea680 to your computer and use it in GitHub Desktop.
Save libbyschuknight/02e502d00a424f0344c22c8aacdea680 to your computer and use it in GitHub Desktop.
testing initialize or not
RSpec.describe CreateInvoice, type: :service do
describe "#initialize" do
context "when CreateInvoice is instantiated " do
fixtures :users
let(:user) { users(:customer_with_read) }
let(:valid_params) do
{
"invoice_date(3i)" => "13",
"invoice_date(2i)" => "1",
"invoice_date(1i)" => "2018",
"price_per_kwh" => "3.3"
}
end
let(:invoice_creator) do
CreateInvoice.new(user: user, params: valid_params)
end
it "has a user" do
expect(invoice_creator.user).to eq(user)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment