Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the invoice number formattable #99

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Make the invoice number formattable #99

wants to merge 3 commits into from

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Nov 3, 2015

In order to satisfy jurisdictions where invoice numbers
have to conform specific formal requirements (number of digits, prefix, whatever)
you can now define a Spree::PrintInvoice::NumberFormattter class
which initializes with a integer, and implements a to_s method returning a
formatted number.

In order to satisfy jurisdictions where invoice numbers
have to conform specific formal requirements (number of digits, prefix, whatever)
you can now define a `Spree::PrintInvoice::NumberFormattter` class
which initializes with a integer, and implements a `to_s` method returning a
formatted number.
end

it 'returns a nicely formatted number' do
expect(base_view.number).to eq("MY-NICE-INVOICE-77")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer single-quoted strings when you don't need string interpolation or special symbols.

Somehow, it worked before without a user being created. This adds the necessary before block.

Also, replace the FactoryGirl.create call with a cheaper FactoryGirl.build.
@tvdeyen
Copy link
Contributor

tvdeyen commented Nov 3, 2015

Could you please add a note about this feature into the README?

😎👌👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants