Created
January 12, 2018 01:34
-
-
Save libbyschuknight/02e502d00a424f0344c22c8aacdea680 to your computer and use it in GitHub Desktop.
testing initialize or not
This file contains hidden or 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
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