invoice_bar 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +15 -0
- data/README.rdoc +3 -0
- data/Rakefile +39 -0
- data/app/assets/javascripts/invoice_bar/invoice_bar.js +98 -0
- data/app/assets/stylesheets/invoice_bar/document.css.scss +170 -0
- data/app/assets/stylesheets/invoice_bar/forms.css.scss +60 -0
- data/app/assets/stylesheets/invoice_bar/invoice_bar.css +10 -0
- data/app/assets/stylesheets/invoice_bar/tables.css.scss +14 -0
- data/app/controllers/invoice_bar/accounts_controller.rb +26 -0
- data/app/controllers/invoice_bar/application_controller.rb +59 -0
- data/app/controllers/invoice_bar/contacts_controller.rb +40 -0
- data/app/controllers/invoice_bar/currencies_controller.rb +29 -0
- data/app/controllers/invoice_bar/dashboard_controller.rb +11 -0
- data/app/controllers/invoice_bar/invoice_templates_controller.rb +108 -0
- data/app/controllers/invoice_bar/invoices_controller.rb +246 -0
- data/app/controllers/invoice_bar/receipt_templates_controller.rb +108 -0
- data/app/controllers/invoice_bar/receipts_controller.rb +164 -0
- data/app/controllers/invoice_bar/search_controller.rb +26 -0
- data/app/controllers/invoice_bar/sessions_controller.rb +35 -0
- data/app/controllers/invoice_bar/settings_controller.rb +12 -0
- data/app/controllers/invoice_bar/users_controller.rb +83 -0
- data/app/helpers/invoice_bar/invoice_bar_helper.rb +43 -0
- data/app/models/invoice_bar/account.rb +50 -0
- data/app/models/invoice_bar/address.rb +48 -0
- data/app/models/invoice_bar/contact.rb +32 -0
- data/app/models/invoice_bar/currency.rb +13 -0
- data/app/models/invoice_bar/invoice.rb +51 -0
- data/app/models/invoice_bar/invoice_template.rb +35 -0
- data/app/models/invoice_bar/item.rb +77 -0
- data/app/models/invoice_bar/receipt.rb +66 -0
- data/app/models/invoice_bar/receipt_template.rb +35 -0
- data/app/models/invoice_bar/user.rb +42 -0
- data/app/views/invoice_bar/accounts/_form.html.erb +25 -0
- data/app/views/invoice_bar/accounts/edit.html.erb +3 -0
- data/app/views/invoice_bar/accounts/index.html.erb +44 -0
- data/app/views/invoice_bar/accounts/new.html.erb +3 -0
- data/app/views/invoice_bar/accounts/show.html.erb +24 -0
- data/app/views/invoice_bar/contacts/_form.html.erb +44 -0
- data/app/views/invoice_bar/contacts/edit.html.erb +3 -0
- data/app/views/invoice_bar/contacts/index.html.erb +42 -0
- data/app/views/invoice_bar/contacts/new.html.erb +3 -0
- data/app/views/invoice_bar/contacts/show.html.erb +43 -0
- data/app/views/invoice_bar/currencies/_form.html.erb +16 -0
- data/app/views/invoice_bar/currencies/edit.html.erb +3 -0
- data/app/views/invoice_bar/currencies/index.html.erb +40 -0
- data/app/views/invoice_bar/currencies/new.html.erb +3 -0
- data/app/views/invoice_bar/currencies/show.html.erb +12 -0
- data/app/views/invoice_bar/documents/_show.html.erb +110 -0
- data/app/views/invoice_bar/forms/_address.html.erb +22 -0
- data/app/views/invoice_bar/forms/_address_fields.html.erb +22 -0
- data/app/views/invoice_bar/forms/_contact_main_fields.html.erb +23 -0
- data/app/views/invoice_bar/forms/_document.html.erb +131 -0
- data/app/views/invoice_bar/forms/_errors.html.erb +17 -0
- data/app/views/invoice_bar/forms/_filter.html.erb +33 -0
- data/app/views/invoice_bar/forms/_item_fields.html.erb +34 -0
- data/app/views/invoice_bar/forms/_items.html.erb +40 -0
- data/app/views/invoice_bar/forms/_payment_fields.html.erb +22 -0
- data/app/views/invoice_bar/invoice_templates/choose_template.html.erb +7 -0
- data/app/views/invoice_bar/invoice_templates/edit.html.erb +2 -0
- data/app/views/invoice_bar/invoice_templates/index.html.erb +51 -0
- data/app/views/invoice_bar/invoice_templates/new.html.erb +3 -0
- data/app/views/invoice_bar/invoice_templates/show.html.erb +1 -0
- data/app/views/invoice_bar/invoices/edit.html.erb +1 -0
- data/app/views/invoice_bar/invoices/index.html.erb +127 -0
- data/app/views/invoice_bar/invoices/new.html.erb +4 -0
- data/app/views/invoice_bar/invoices/show.html.erb +1 -0
- data/app/views/invoice_bar/invoices/show.pdf.prawn +128 -0
- data/app/views/invoice_bar/layouts/_head.html.erb +5 -0
- data/app/views/invoice_bar/layouts/_messages.html.erb +8 -0
- data/app/views/invoice_bar/layouts/_navbar.html.erb +40 -0
- data/app/views/invoice_bar/layouts/signed_in.html.erb +20 -0
- data/app/views/invoice_bar/layouts/signed_out.html.erb +29 -0
- data/app/views/invoice_bar/receipt_templates/choose_template.html.erb +7 -0
- data/app/views/invoice_bar/receipt_templates/edit.html.erb +1 -0
- data/app/views/invoice_bar/receipt_templates/index.html.erb +51 -0
- data/app/views/invoice_bar/receipt_templates/new.html.erb +3 -0
- data/app/views/invoice_bar/receipt_templates/show.html.erb +1 -0
- data/app/views/invoice_bar/receipts/edit.html.erb +1 -0
- data/app/views/invoice_bar/receipts/index.html.erb +82 -0
- data/app/views/invoice_bar/receipts/new.html.erb +4 -0
- data/app/views/invoice_bar/receipts/show.html.erb +1 -0
- data/app/views/invoice_bar/receipts/show.pdf.prawn +128 -0
- data/app/views/invoice_bar/search/index.html.erb +201 -0
- data/app/views/invoice_bar/sessions/new.html.erb +23 -0
- data/app/views/invoice_bar/settings/index.html.erb +42 -0
- data/app/views/invoice_bar/users/_form.html.erb +32 -0
- data/app/views/invoice_bar/users/edit.html.erb +1 -0
- data/app/views/invoice_bar/users/index.html.erb +46 -0
- data/app/views/invoice_bar/users/new.html.erb +1 -0
- data/app/views/invoice_bar/users/show.html.erb +0 -0
- data/app/views/invoice_bar/users/signup.html.erb +25 -0
- data/app/views/kaminari/_first_page.html.erb +3 -0
- data/app/views/kaminari/_gap.html.erb +3 -0
- data/app/views/kaminari/_last_page.html.erb +3 -0
- data/app/views/kaminari/_next_page.html.erb +3 -0
- data/app/views/kaminari/_page.html.erb +3 -0
- data/app/views/kaminari/_paginator.html.erb +17 -0
- data/app/views/kaminari/_prev_page.html.erb +3 -0
- data/config/database.yml +25 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/encoding.rb +3 -0
- data/config/initializers/inflections.rb +15 -0
- data/config/initializers/kaminari_config.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/requires.rb +4 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/sorcery.rb +401 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/cs.yml +424 -0
- data/config/routes.rb +50 -0
- data/db/migrate/20121012142346_create_invoice_bar_addresses.rb +16 -0
- data/db/migrate/20121012142357_create_invoice_bar_invoice_templates.rb +20 -0
- data/db/migrate/20121012142418_create_invoice_bar_invoices.rb +27 -0
- data/db/migrate/20121012142428_create_invoice_bar_accounts.rb +17 -0
- data/db/migrate/20121012142442_create_invoice_bar_items.rb +17 -0
- data/db/migrate/20121012142454_create_invoice_bar_currencies.rb +9 -0
- data/db/migrate/20121012142502_create_invoice_bar_contacts.rb +19 -0
- data/db/migrate/20121012144941_create_invoice_bar_users.rb +24 -0
- data/db/migrate/20121205185321_create_invoice_bar_receipts.rb +21 -0
- data/db/migrate/20121205185353_create_invoice_bar_receipt_templates.rb +18 -0
- data/db/seeds.rb +33 -0
- data/db/test.sqlite3 +0 -0
- data/lib/billable.rb +305 -0
- data/lib/invoice_bar/engine.rb +80 -0
- data/lib/invoice_bar/version.rb +5 -0
- data/lib/invoice_bar.rb +7 -0
- data/lib/searchable.rb +34 -0
- data/lib/tasks/invoicebar_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +68 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/invoice_bar.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/production.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +174 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +549752 -0
- data/test/dummy/log/production.log +12 -0
- data/test/dummy/log/test.log +8610 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/tmp/cache/assets/BF2/9B0/sprockets%2F1649cd914028570da99e391611416461 +0 -0
- data/test/dummy/tmp/cache/assets/C11/6D0/sprockets%2F33531011fa6963571866f11d2c35313d +0 -0
- data/test/dummy/tmp/cache/assets/C13/000/sprockets%2F5357734603b21a0c32f75614f7067c31 +0 -0
- data/test/dummy/tmp/cache/assets/C34/BA0/sprockets%2F476d3ab21730a46162605402631fe23a +0 -0
- data/test/dummy/tmp/cache/assets/C4B/E90/sprockets%2F035a31410d4460e61989eeb25886c270 +0 -0
- data/test/dummy/tmp/cache/assets/C4E/B20/sprockets%2F7318bf12f2451e817f480b607c746332 +0 -0
- data/test/dummy/tmp/cache/assets/C57/D20/sprockets%2Ff88514480770419cd12db0649278b84a +0 -0
- data/test/dummy/tmp/cache/assets/C58/6A0/sprockets%2F353374217619061b5ce3969c7cd819b3 +0 -0
- data/test/dummy/tmp/cache/assets/C65/E00/sprockets%2F672e89378f0995592ad01994536ba60b +0 -0
- data/test/dummy/tmp/cache/assets/C6B/6E0/sprockets%2F3028ed1b448217ad51235f70e14814c0 +0 -0
- data/test/dummy/tmp/cache/assets/C6B/720/sprockets%2F371c30ee6af2d2121712842394d550b3 +0 -0
- data/test/dummy/tmp/cache/assets/C74/FF0/sprockets%2F2935380ab04cd59423316d55eb65b432 +0 -0
- data/test/dummy/tmp/cache/assets/C7E/450/sprockets%2F9cfb945244675bb31d32d80c18317822 +0 -0
- data/test/dummy/tmp/cache/assets/C89/6B0/sprockets%2F32372ed7818205654f9b4c6c0f398e41 +0 -0
- data/test/dummy/tmp/cache/assets/C8B/580/sprockets%2F643c9f08f9f01f35717241752c6d656b +0 -0
- data/test/dummy/tmp/cache/assets/C8D/D10/sprockets%2F637cba17049670418f4286ee7a3e8295 +0 -0
- data/test/dummy/tmp/cache/assets/C8E/6E0/sprockets%2Fc66d4743799007238128516ff08dfb6c +0 -0
- data/test/dummy/tmp/cache/assets/C93/450/sprockets%2Fe7ba340a2482428011300d2ee814f2b6 +0 -0
- data/test/dummy/tmp/cache/assets/C9A/F10/sprockets%2F70b1f5795498d49c48f11a58e094773f +0 -0
- data/test/dummy/tmp/cache/assets/CA2/E20/sprockets%2F8f0f457319183311b10ddc6e0337de41 +0 -0
- data/test/dummy/tmp/cache/assets/CA3/830/sprockets%2F9a9d172e93422b2192f1a5b80520a7c4 +0 -0
- data/test/dummy/tmp/cache/assets/CAD/870/sprockets%2Fa360887b06bad5328d1870349fae6126 +0 -0
- data/test/dummy/tmp/cache/assets/CB2/DE0/sprockets%2F639a912fd05bb9acb75624b343618558 +0 -0
- data/test/dummy/tmp/cache/assets/CB3/630/sprockets%2F501a45647fb70ab06d9d9566b9f11682 +0 -0
- data/test/dummy/tmp/cache/assets/CB9/620/sprockets%2F48651b5837773c5c3f3024e5b713f8ed +0 -0
- data/test/dummy/tmp/cache/assets/CBB/730/sprockets%2F93687f971b297d0d1e0a4721e5487c2d +0 -0
- data/test/dummy/tmp/cache/assets/CC0/4E0/sprockets%2F0a4620c09e33f12c747fbd798975788b +0 -0
- data/test/dummy/tmp/cache/assets/CC2/320/sprockets%2F6f4db22314397e4f29367682f7ad4b69 +0 -0
- data/test/dummy/tmp/cache/assets/CC3/3D0/sprockets%2F089add15d2a400824da7221e2b81d034 +0 -0
- data/test/dummy/tmp/cache/assets/CC7/C30/sprockets%2Fadb5bf6286f95889bb40657a27195638 +0 -0
- data/test/dummy/tmp/cache/assets/CCE/490/sprockets%2F07411fdbe680b6812f75ad74ca421060 +0 -0
- data/test/dummy/tmp/cache/assets/CD5/440/sprockets%2F4a93eaa36745c41235d49703bc1e2a94 +0 -0
- data/test/dummy/tmp/cache/assets/CD5/6A0/sprockets%2Fd8483c8cc949e29761ed8d26f9981821 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/830/sprockets%2Ffd04d8117670102499a9cc26e03beb91 +0 -0
- data/test/dummy/tmp/cache/assets/CDA/7E0/sprockets%2F08273270e5ad4e8c40f032ae65f359a6 +0 -0
- data/test/dummy/tmp/cache/assets/CDB/4A0/sprockets%2F9ffe20f0f1056553046b042d4e752d8e +0 -0
- data/test/dummy/tmp/cache/assets/CDB/DD0/sprockets%2F77011cabd37795e415d3b39c27ac8532 +0 -0
- data/test/dummy/tmp/cache/assets/CDC/3B0/sprockets%2F7b0af18e9e71d15c3bb63853295016d4 +0 -0
- data/test/dummy/tmp/cache/assets/CDE/800/sprockets%2F416bd8cb992bd8c80b742034c4286a81 +0 -0
- data/test/dummy/tmp/cache/assets/CDF/B00/sprockets%2F3854abaa9035337b6ae850f481b69d81 +0 -0
- data/test/dummy/tmp/cache/assets/CE1/B50/sprockets%2F60b3d77c8e86d79212403cddca614934 +0 -0
- data/test/dummy/tmp/cache/assets/CE2/120/sprockets%2F46ae2947ec023073bbe827de1d615579 +0 -0
- data/test/dummy/tmp/cache/assets/CE2/610/sprockets%2F77999ce208b427f3d1cd786a01d0170d +0 -0
- data/test/dummy/tmp/cache/assets/CE4/D30/sprockets%2F3c72e61f887354ae35f015f9d4a06d17 +0 -0
- data/test/dummy/tmp/cache/assets/CE6/2C0/sprockets%2Fc1346d6629ff13645b4e2ce9c61a2893 +0 -0
- data/test/dummy/tmp/cache/assets/CE6/A90/sprockets%2F0d30a948c673d664a672e936f5b4a8d1 +0 -0
- data/test/dummy/tmp/cache/assets/CE9/850/sprockets%2Fc0201847da9589eebe5b28c66872b417 +0 -0
- data/test/dummy/tmp/cache/assets/CEA/9E0/sprockets%2Fdfedfb73194983c312432973ade78720 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/D20/sprockets%2Fd2d3fcca91c5f7f325e1839984082592 +0 -0
- data/test/dummy/tmp/cache/assets/CF2/C90/sprockets%2F94a5468a372fd075ca78973f780c1fc6 +0 -0
- data/test/dummy/tmp/cache/assets/CF5/D40/sprockets%2F061b2b8dc611337ead0ae1630d9d6412 +0 -0
- data/test/dummy/tmp/cache/assets/CF8/310/sprockets%2F50b6e57b9678d674917d9d7ace69d022 +0 -0
- data/test/dummy/tmp/cache/assets/CF8/D30/sprockets%2Ff19cb0e8a30eb388c418d11240d152d0 +0 -0
- data/test/dummy/tmp/cache/assets/CFE/410/sprockets%2Fd9f0b12757bcfd24db130773b412314f +0 -0
- data/test/dummy/tmp/cache/assets/D00/F20/sprockets%2F8b4c51c2d4c103d0d6a468ac625c1658 +0 -0
- data/test/dummy/tmp/cache/assets/D02/010/sprockets%2F4569921d8d0226a3e2d57ad01620ecbe +0 -0
- data/test/dummy/tmp/cache/assets/D02/340/sprockets%2F1036c0439cb6b47c2c2fc1712b8e657b +0 -0
- data/test/dummy/tmp/cache/assets/D02/C00/sprockets%2F8ccbad1c51529c475316bb90801fe315 +0 -0
- data/test/dummy/tmp/cache/assets/D03/9C0/sprockets%2Fc96d3e1ca1315cab038596f20d0792f1 +0 -0
- data/test/dummy/tmp/cache/assets/D03/B20/sprockets%2F08d6902adcd450723918aeab800b159e +0 -0
- data/test/dummy/tmp/cache/assets/D04/BC0/sprockets%2F27be5fd4190e64c12116475ecc09c2c2 +0 -0
- data/test/dummy/tmp/cache/assets/D05/6B0/sprockets%2F51d171ec47d28c1d5722d2b86a0d1f65 +0 -0
- data/test/dummy/tmp/cache/assets/D06/E80/sprockets%2Fe62e39d519ee0a8131fae43440c153e5 +0 -0
- data/test/dummy/tmp/cache/assets/D09/F80/sprockets%2F0b34327edf1e11f0da567616d772c7e4 +0 -0
- data/test/dummy/tmp/cache/assets/D0A/B60/sprockets%2F42131e5fd69f30b0d08266afda8913e5 +0 -0
- data/test/dummy/tmp/cache/assets/D0F/390/sprockets%2F5132b836fb094301ff28a6be7dd16d77 +0 -0
- data/test/dummy/tmp/cache/assets/D0F/A70/sprockets%2F92ec90512978b6c597112bcaf1da29c3 +0 -0
- data/test/dummy/tmp/cache/assets/D0F/B20/sprockets%2Fa0a35bd579e7223e80e1a749e7f2a734 +0 -0
- data/test/dummy/tmp/cache/assets/D12/4C0/sprockets%2F88cb06f8a7fb491631fa0093781cd05f +0 -0
- data/test/dummy/tmp/cache/assets/D19/3F0/sprockets%2F5de5ba4c867332253b5098d0d1f9ef68 +0 -0
- data/test/dummy/tmp/cache/assets/D1A/990/sprockets%2F08909075dd6adc239945db46e13e3fb9 +0 -0
- data/test/dummy/tmp/cache/assets/D1C/C80/sprockets%2F4fa92f7c8915da6aa468ed76560953b0 +0 -0
- data/test/dummy/tmp/cache/assets/D1D/3F0/sprockets%2F97be6327d4928ac25347c4cc773e66da +0 -0
- data/test/dummy/tmp/cache/assets/D1E/230/sprockets%2Ff4317e07329a7c47de1c83f63e8f6a84 +0 -0
- data/test/dummy/tmp/cache/assets/D21/190/sprockets%2Fe4c9d0a614ae75783a09fc7e952d7198 +0 -0
- data/test/dummy/tmp/cache/assets/D23/290/sprockets%2F1d514a434ff003bf9c55a23a408bc5a1 +0 -0
- data/test/dummy/tmp/cache/assets/D23/F40/sprockets%2Fd7a8df989fa0b8678a833877b220e0b7 +0 -0
- data/test/dummy/tmp/cache/assets/D24/1D0/sprockets%2F88354bcfd9280ced1df9853346b9c294 +0 -0
- data/test/dummy/tmp/cache/assets/D25/040/sprockets%2F3eb1238aefc0b348a7218c93ae001b06 +0 -0
- data/test/dummy/tmp/cache/assets/D2D/3E0/sprockets%2F98fc4b59de5e8d96ae5746480a2e9129 +0 -0
- data/test/dummy/tmp/cache/assets/D2E/310/sprockets%2F26abc5030ac50e298349385e5dbaa5d0 +0 -0
- data/test/dummy/tmp/cache/assets/D30/1A0/sprockets%2Fa1d4848a05a94bf03d1cb69451e0e32e +0 -0
- data/test/dummy/tmp/cache/assets/D31/0D0/sprockets%2F8e968fb5539c735f9e65a2c338990ebe +0 -0
- data/test/dummy/tmp/cache/assets/D32/3E0/sprockets%2F51d82b9d10a1f278193ae09b2e6cc14c +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D33/120/sprockets%2F41ac728e4d2c9fc115030eb2fa94455d +0 -0
- data/test/dummy/tmp/cache/assets/D33/EE0/sprockets%2F285d50fab811d6aab44360b43b358ee8 +0 -0
- data/test/dummy/tmp/cache/assets/D36/4F0/sprockets%2F6a5e6e2e8a23e1c5e7359e4018ba1a16 +0 -0
- data/test/dummy/tmp/cache/assets/D37/6B0/sprockets%2Ffb4b7383d900b9103ee4eeb16a49156a +0 -0
- data/test/dummy/tmp/cache/assets/D38/4B0/sprockets%2F4628f5361aa685f70bdbc0efb715c702 +0 -0
- data/test/dummy/tmp/cache/assets/D39/180/sprockets%2Fb6a2dcb4f4b6904a6e5f5a5b38572324 +0 -0
- data/test/dummy/tmp/cache/assets/D39/E50/sprockets%2F1e19909eba7771baae63c28571d213dc +0 -0
- data/test/dummy/tmp/cache/assets/D3A/220/sprockets%2F4ba28941ec4418b83a3e08f5e4b3f22e +0 -0
- data/test/dummy/tmp/cache/assets/D3D/0C0/sprockets%2F5f4828a143b7a17c86ad173af45ea44f +0 -0
- data/test/dummy/tmp/cache/assets/D3E/D80/sprockets%2F26a353f794ccad1723ad26d564963dae +0 -0
- data/test/dummy/tmp/cache/assets/D3F/EE0/sprockets%2F4d4955da738ce18fcb5d5c254c20471d +0 -0
- data/test/dummy/tmp/cache/assets/D40/C00/sprockets%2Fafe2733518c27c73f2d19f27edc5c063 +0 -0
- data/test/dummy/tmp/cache/assets/D42/790/sprockets%2F54ebab76bb0c774f441f24a9b049a699 +0 -0
- data/test/dummy/tmp/cache/assets/D49/080/sprockets%2F47eee138813998c77fb4d63aea0a83b2 +0 -0
- data/test/dummy/tmp/cache/assets/D4A/F80/sprockets%2F573908d07c7e4a37eb475c916f44eaeb +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D4F/950/sprockets%2Ffe8890753c95311541bfee8ec93bf6a3 +0 -0
- data/test/dummy/tmp/cache/assets/D50/660/sprockets%2F8934155ef2c7db6ff48de8d6a572b352 +0 -0
- data/test/dummy/tmp/cache/assets/D50/990/sprockets%2F2f7692187d5d687fd78bcbdd44583a0a +0 -0
- data/test/dummy/tmp/cache/assets/D52/BE0/sprockets%2F95f7169a509d1fe46b4b8b7f0d9b9d25 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D5B/270/sprockets%2Fd7121a8e796ab4de09bb1d140a03bd38 +0 -0
- data/test/dummy/tmp/cache/assets/D5B/B80/sprockets%2F420c9ca8933da2c7ac42af560ba80a72 +0 -0
- data/test/dummy/tmp/cache/assets/D5E/9A0/sprockets%2Fcbae55800082a9de23b02dc0f7416c7f +0 -0
- data/test/dummy/tmp/cache/assets/D60/890/sprockets%2Fa63fc11056490cd0ad51c725eea3cd87 +0 -0
- data/test/dummy/tmp/cache/assets/D60/F10/sprockets%2F251e00aea88ff5a6c41ed112283f1ef4 +0 -0
- data/test/dummy/tmp/cache/assets/D61/310/sprockets%2Ff9192502dcd75958872e1edf6cd8e89e +0 -0
- data/test/dummy/tmp/cache/assets/D62/480/sprockets%2Feb89e74e65edfd75c4048038f7e4897c +0 -0
- data/test/dummy/tmp/cache/assets/D63/D60/sprockets%2Fcca470eef56334f9ee3600394ca06a0c +0 -0
- data/test/dummy/tmp/cache/assets/D64/800/sprockets%2F8be19b06af6bb950af657a2a500c459a +0 -0
- data/test/dummy/tmp/cache/assets/D66/EC0/sprockets%2F5b533bbfba939b541a49cd9fb302364b +0 -0
- data/test/dummy/tmp/cache/assets/D67/CC0/sprockets%2Fd6be1951f1e10b034d95fc7e317ade62 +0 -0
- data/test/dummy/tmp/cache/assets/D69/ED0/sprockets%2F8573a0c480d82a6de7d4431cec53ecb4 +0 -0
- data/test/dummy/tmp/cache/assets/D6D/310/sprockets%2F9accebd1400d2d65bc13881889ea5e54 +0 -0
- data/test/dummy/tmp/cache/assets/D70/E30/sprockets%2Fdb69f2e4f8e94a52181602e81b7dda1c +0 -0
- data/test/dummy/tmp/cache/assets/D71/270/sprockets%2F87be1f988bb5dec8ad602202d66e61d1 +0 -0
- data/test/dummy/tmp/cache/assets/D71/DD0/sprockets%2Fdb33de95e82ca2e939a7a1173cd19a57 +0 -0
- data/test/dummy/tmp/cache/assets/D73/850/sprockets%2F1e6628b9b7568f1c549eeaaf5a101f4d +0 -0
- data/test/dummy/tmp/cache/assets/D74/350/sprockets%2F2a7fa3c361bcd65892a8d8cc4c7772d3 +0 -0
- data/test/dummy/tmp/cache/assets/D76/8E0/sprockets%2F5af05ee642ef7c6c480c59d2683c05cf +0 -0
- data/test/dummy/tmp/cache/assets/D79/530/sprockets%2F87127ee1c6bcf4b91d8e5f2eda951842 +0 -0
- data/test/dummy/tmp/cache/assets/D7E/7D0/sprockets%2F44be519f93759ef9d6faa21a8e532b7c +0 -0
- data/test/dummy/tmp/cache/assets/D7E/B50/sprockets%2Fd1d6bc2c8e90a69086a3fdd51d49e779 +0 -0
- data/test/dummy/tmp/cache/assets/D81/2E0/sprockets%2F0d2d4106bae377afa11cfc40ba8f6222 +0 -0
- data/test/dummy/tmp/cache/assets/D81/BE0/sprockets%2Fd17fbca0deb79f1d5fb200b13158010c +0 -0
- data/test/dummy/tmp/cache/assets/D82/950/sprockets%2F1f8a65498915f9fbdf8b2da74db800d8 +0 -0
- data/test/dummy/tmp/cache/assets/D87/2B0/sprockets%2Ffaf16963d8b856b046a1a96fef6d898b +0 -0
- data/test/dummy/tmp/cache/assets/D8A/CA0/sprockets%2F63b0ad83380a8b15a52c34cafe5c2de3 +0 -0
- data/test/dummy/tmp/cache/assets/D94/470/sprockets%2F3bf12b0f588dafba93c72a8ae1d20719 +0 -0
- data/test/dummy/tmp/cache/assets/D95/FB0/sprockets%2F7c5d5a248061ab4c0db3935cc39ff0fc +0 -0
- data/test/dummy/tmp/cache/assets/D97/2B0/sprockets%2Fd1ddf0ff80e01a73c31b2ced62877a94 +0 -0
- data/test/dummy/tmp/cache/assets/D98/0E0/sprockets%2F8f1dba887ccd80e10b70c026a3ce498b +0 -0
- data/test/dummy/tmp/cache/assets/D99/730/sprockets%2F6f1142f8fa2beb906b4a9ccd8e03a546 +0 -0
- data/test/dummy/tmp/cache/assets/D99/B70/sprockets%2F3330226a3ee4588f0e6c083dcbcef6fa +0 -0
- data/test/dummy/tmp/cache/assets/D99/D60/sprockets%2Fa5a6f50cb869da7b5d4170b7b2d7e2a6 +0 -0
- data/test/dummy/tmp/cache/assets/D9E/1F0/sprockets%2Fb51430da8d69a96e5689aafa8c0ac71b +0 -0
- data/test/dummy/tmp/cache/assets/D9E/460/sprockets%2F717a54dade795a66c2f6daea7c325a80 +0 -0
- data/test/dummy/tmp/cache/assets/DA1/6E0/sprockets%2F8ad3ca6d1c8f263b9cedad086e598122 +0 -0
- data/test/dummy/tmp/cache/assets/DA3/3E0/sprockets%2F37a6f8767ca6016b823aaccee078c8bf +0 -0
- data/test/dummy/tmp/cache/assets/DA4/640/sprockets%2F758aa928cedd052eb72b6c4d7dc438b6 +0 -0
- data/test/dummy/tmp/cache/assets/DA6/BD0/sprockets%2Ff7c34df9d6167bc3a49b90f74bd82a2c +0 -0
- data/test/dummy/tmp/cache/assets/DA9/280/sprockets%2Fc3386f232e36f9522dff1af8eb7d4e4d +0 -0
- data/test/dummy/tmp/cache/assets/DA9/BA0/sprockets%2F67d5749f62dd1a31ea998fdfc2b2e6c0 +0 -0
- data/test/dummy/tmp/cache/assets/DB0/610/sprockets%2F27f0e95fc9f245cfe45afd4d1f362a99 +0 -0
- data/test/dummy/tmp/cache/assets/DB1/AE0/sprockets%2Fbcf7eefe90b850e5b45267f2691c8ee5 +0 -0
- data/test/dummy/tmp/cache/assets/DB1/CC0/sprockets%2F449b63a2ccce6c96ca656fe56f4f29b8 +0 -0
- data/test/dummy/tmp/cache/assets/DB6/8D0/sprockets%2F99b8bcd8e7ac9e932a271c13e98fee45 +0 -0
- data/test/dummy/tmp/cache/assets/DBD/470/sprockets%2F449cee166e97d8dd62dcf38dc48f47c6 +0 -0
- data/test/dummy/tmp/cache/assets/DC3/D20/sprockets%2Fade0348f1f4f6d204cf07c256ccd33fa +0 -0
- data/test/dummy/tmp/cache/assets/DC5/510/sprockets%2Fddbe0b0bccf8028b03ef7993c5af8320 +0 -0
- data/test/dummy/tmp/cache/assets/DC6/880/sprockets%2F95ecea645241bc5c7263fbaf5bf3f2b0 +0 -0
- data/test/dummy/tmp/cache/assets/DC6/CD0/sprockets%2F2faab17861cdba1eb9e317d38a76da64 +0 -0
- data/test/dummy/tmp/cache/assets/DCA/B50/sprockets%2Fd3d82ca385d97142b4e57c7dca6fca0a +0 -0
- data/test/dummy/tmp/cache/assets/DCE/020/sprockets%2F6ce5583d1ef1afd8d72012c6dc9a4f4c +0 -0
- data/test/dummy/tmp/cache/assets/DCE/EA0/sprockets%2F8119567d3d979c4b91fea2b2bcaaefb0 +0 -0
- data/test/dummy/tmp/cache/assets/DD0/7F0/sprockets%2Fef2fa8f93ebd90602b488eaf3a0e554a +0 -0
- data/test/dummy/tmp/cache/assets/DD3/850/sprockets%2F3f0d25d896ebcb795fbcac0f45d874b0 +0 -0
- data/test/dummy/tmp/cache/assets/DDB/8C0/sprockets%2F837f7b8e8f33dbae4de34ba908bd328f +0 -0
- data/test/dummy/tmp/cache/assets/DDB/DA0/sprockets%2F3f6a3c8e4688abce408f6caf5b8dd653 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DDD/1E0/sprockets%2F596348d03c6fbcd9ac02fb9dbde6c878 +0 -0
- data/test/dummy/tmp/cache/assets/DE5/B70/sprockets%2Fc77a5e9b5e4f9fd02af4c1ed88d69d73 +0 -0
- data/test/dummy/tmp/cache/assets/DF0/CF0/sprockets%2F644ea5f42501f70e1a3daffaa5b9d1fd +0 -0
- data/test/dummy/tmp/cache/assets/DF2/260/sprockets%2F35c0090f47903a5efee65ac30cddccaf +0 -0
- data/test/dummy/tmp/cache/assets/DF5/5F0/sprockets%2F7f6b1930adca83a531ddbaa53ad76ee9 +0 -0
- data/test/dummy/tmp/cache/assets/DF6/390/sprockets%2Fa1c2e7c32b51dbfb4e5cb62f9f43a7a9 +0 -0
- data/test/dummy/tmp/cache/assets/DF8/B40/sprockets%2F037ccfb8fa7231bfa7ffbc59d070c3d4 +0 -0
- data/test/dummy/tmp/cache/assets/DFB/F00/sprockets%2F010dfb576ac2abb5d9d8ee5a9f6d328a +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E05/460/sprockets%2Fefc998afbc280b66df981c0ea0ea29c4 +0 -0
- data/test/dummy/tmp/cache/assets/E13/660/sprockets%2F1307359c773fdc80cdee9cf87efdd6fa +0 -0
- data/test/dummy/tmp/cache/assets/E1B/2A0/sprockets%2F6a86e3ac6f50aadb84ef5a3600adbc1d +0 -0
- data/test/dummy/tmp/cache/assets/E1B/B40/sprockets%2Fff174762b8bfd6df1fd9ad6fed18896d +0 -0
- data/test/dummy/tmp/cache/assets/E1E/220/sprockets%2F2c2fccd808a30aff0b21fac944dc6c7c +0 -0
- data/test/dummy/tmp/cache/assets/E21/3B0/sprockets%2Fabaa5df24f3535acc9cdfd56b0e0b349 +0 -0
- data/test/dummy/tmp/cache/assets/E32/120/sprockets%2F13ebfca6482f8e2fec5eface39805b2d +0 -0
- data/test/dummy/tmp/cache/assets/E32/1B0/sprockets%2F8539ffcc451cffbed1e1c8f09fa5a1c5 +0 -0
- data/test/dummy/tmp/cache/assets/E34/E20/sprockets%2F1a542cad56953aff56cbfbf337fcf9af +0 -0
- data/test/dummy/tmp/cache/assets/E3B/040/sprockets%2Fb8f87d0eb5a059cec709bdff6f7bfc15 +0 -0
- data/test/dummy/tmp/cache/assets/E5B/6A0/sprockets%2Fe58ffacd2cad19c5f5bda5b91f4620bf +0 -0
- data/test/dummy/tmp/cache/assets/E5C/840/sprockets%2Fcbfdfc7aeac880cc161f9fa61af654c3 +0 -0
- data/test/dummy/tmp/cache/assets/E68/250/sprockets%2F88d5fa5be6cb9d7e540bad6e94bdd8aa +0 -0
- data/test/dummy/tmp/cache/assets/E6F/F60/sprockets%2Fcf91796bdc66abbcde70ce9fcf47a76d +0 -0
- data/test/dummy/tmp/cache/assets/E7D/DA0/sprockets%2F3a4ceceac3e02f2a7b82dcf3f25ea7ad +0 -0
- data/test/dummy/tmp/cache/assets/E81/0E0/sprockets%2Fcc36d9cdd3fc1c5a8d1b54ccfadad352 +0 -0
- data/test/dummy/tmp/cache/assets/EBE/170/sprockets%2Fa7a17e1d2fe6fb6d5e368cfeddfae1ca +0 -0
- data/test/dummy/tmp/cache/assets/EED/8B0/sprockets%2F2c35ce7baabe8d64cceace7cb95bfd9a +0 -0
- data/test/dummy/tmp/cache/sass/286d476815ae5a0d73c086d611d7e534638a4c9a/document.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/286d476815ae5a0d73c086d611d7e534638a4c9a/forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/286d476815ae5a0d73c086d611d7e534638a4c9a/tables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_accordion.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_alerts.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_breadcrumbs.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_button-groups.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_buttons.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_carousel.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_close.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_code.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_component-animations.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_dropdowns.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_forms.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_grid.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_hero-unit.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_labels-badges.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_layouts.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_media.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_mixins.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_modals.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_navbar.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_navs.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_pager.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_pagination.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_popovers.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_progress-bars.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_reset.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_responsive-1200px-min.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_responsive-767px-max.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_responsive-768px-979px.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_responsive-navbar.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_responsive-utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_scaffolding.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_sprites.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_tables.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_thumbnails.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_tooltip.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_type.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_variables.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/_wells.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/bootstrap.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9c4049ac4ab21c80305c119b565d8ccee297f91e/responsive.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e3442098eb9df3b4438ecccd23acb9a9a8b7fa1f/bootstrap-responsive.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e3442098eb9df3b4438ecccd23acb9a9a8b7fa1f/bootstrap.scssc +0 -0
- data/test/factories/invoice_bar_account.rb +16 -0
- data/test/factories/invoice_bar_address.rb +10 -0
- data/test/factories/invoice_bar_contact.rb +7 -0
- data/test/factories/invoice_bar_currency.rb +7 -0
- data/test/factories/invoice_bar_invoice.rb +28 -0
- data/test/factories/invoice_bar_invoice_template.rb +22 -0
- data/test/factories/invoice_bar_item.rb +7 -0
- data/test/factories/invoice_bar_receipt.rb +27 -0
- data/test/factories/invoice_bar_receipt_template.rb +21 -0
- data/test/factories/invoice_bar_user.rb +9 -0
- data/test/functional/invoice_bar/accounts_controller_test.rb +65 -0
- data/test/functional/invoice_bar/contacts_controller_test.rb +67 -0
- data/test/functional/invoice_bar/currencies_controller_test.rb +59 -0
- data/test/functional/invoice_bar/invoice_templates_controller_test.rb +71 -0
- data/test/functional/invoice_bar/invoices_controller_test.rb +76 -0
- data/test/functional/invoice_bar/receipt_templates_controller_test.rb +67 -0
- data/test/functional/invoice_bar/receipts_controller_test.rb +68 -0
- data/test/functional/invoice_bar/users_controller_test.rb +83 -0
- data/test/invoice_bar_test.rb +7 -0
- data/test/performance/browsing_test.rb +14 -0
- data/test/test_helper.rb +40 -0
- data/test/unit/invoice_bar/account_test.rb +31 -0
- data/test/unit/invoice_bar/address_test.rb +31 -0
- data/test/unit/invoice_bar/contact_test.rb +17 -0
- data/test/unit/invoice_bar/currency_test.rb +13 -0
- data/test/unit/invoice_bar/helpers/invoice_bar_helper_test.rb +19 -0
- data/test/unit/invoice_bar/invoice_template_test.rb +36 -0
- data/test/unit/invoice_bar/invoice_test.rb +67 -0
- data/test/unit/invoice_bar/item_test.rb +48 -0
- data/test/unit/invoice_bar/receipt_template_test.rb +34 -0
- data/test/unit/invoice_bar/receipt_test.rb +48 -0
- data/test/unit/invoice_bar/user_test.rb +29 -0
- metadata +1030 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::ReceiptTemplatesControllerTest < ActionController::TestCase
|
|
6
|
+
setup do
|
|
7
|
+
@user = FactoryGirl.create(:invoice_bar_user)
|
|
8
|
+
@account = FactoryGirl.create(:invoice_bar_account, :user => @user)
|
|
9
|
+
@receipt_template = FactoryGirl.create(:invoice_bar_receipt_template, :user => @user, :account => @account)
|
|
10
|
+
|
|
11
|
+
login_user
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get index" do
|
|
15
|
+
get :index, use_route: :invoice_bar
|
|
16
|
+
assert_response :success
|
|
17
|
+
assert_not_nil assigns(:receipt_templates)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
test "should get new" do
|
|
21
|
+
get :new, use_route: :invoice_bar
|
|
22
|
+
assert_response :success
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
test "should create receipt_template" do
|
|
26
|
+
@new_receipt_template = FactoryGirl.build(:invoice_bar_receipt_template, :user => @user, :account => @account, :name => 'Another template')
|
|
27
|
+
|
|
28
|
+
assert_difference('InvoiceBar::ReceiptTemplate.count') do
|
|
29
|
+
post :create, receipt_template: {
|
|
30
|
+
account_id: @new_receipt_template.account_id,
|
|
31
|
+
amount: @new_receipt_template.amount,
|
|
32
|
+
contact_dic: @new_receipt_template.contact_dic,
|
|
33
|
+
contact_ic: @new_receipt_template.contact_ic,
|
|
34
|
+
contact_name: @new_receipt_template.contact_name,
|
|
35
|
+
issue_date: @new_receipt_template.issue_date,
|
|
36
|
+
name: @new_receipt_template.name }, use_route: :invoice_bar
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
test "should show receipt_template" do
|
|
41
|
+
get :show, use_route: :invoice_bar, id: @receipt_template
|
|
42
|
+
assert_response :success
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
test "should get edit" do
|
|
46
|
+
get :edit, use_route: :invoice_bar, id: @receipt_template
|
|
47
|
+
assert_response :success
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
test "should update receipt_template" do
|
|
51
|
+
put :update, id: @receipt_template, receipt_template: {
|
|
52
|
+
account_id: @receipt_template.account_id,
|
|
53
|
+
amount: @receipt_template.amount,
|
|
54
|
+
contact_dic: @receipt_template.contact_dic,
|
|
55
|
+
contact_ic: @receipt_template.contact_ic,
|
|
56
|
+
contact_name: @receipt_template.contact_name,
|
|
57
|
+
issue_date: @receipt_template.issue_date,
|
|
58
|
+
name: @receipt_template.name,
|
|
59
|
+
user_id: @receipt_template.user_id }, use_route: :invoice_bar
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
test "should destroy receipt_template" do
|
|
63
|
+
assert_difference('InvoiceBar::ReceiptTemplate.count', -1) do
|
|
64
|
+
delete :destroy, use_route: :invoice_bar, id: @receipt_template
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::ReceiptsControllerTest < ActionController::TestCase
|
|
6
|
+
setup do
|
|
7
|
+
@user = FactoryGirl.create(:invoice_bar_user)
|
|
8
|
+
@account = FactoryGirl.create(:invoice_bar_account, :user => @user)
|
|
9
|
+
@receipt = FactoryGirl.create(:invoice_bar_receipt, :user => @user, :account => @account)
|
|
10
|
+
|
|
11
|
+
login_user
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
test "should get index" do
|
|
15
|
+
get :index, use_route: :invoice_bar
|
|
16
|
+
assert_response :success
|
|
17
|
+
assert_not_nil assigns(:receipts)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
test "should get new" do
|
|
21
|
+
get :new, use_route: :invoice_bar
|
|
22
|
+
assert_response :success
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
test "should create receipt" do
|
|
26
|
+
@new_receipt = FactoryGirl.build(:invoice_bar_receipt, :user => @user, :account => @account)
|
|
27
|
+
|
|
28
|
+
assert_difference('InvoiceBar::Receipt.count') do
|
|
29
|
+
post :create, receipt: {
|
|
30
|
+
number: @new_receipt.number,
|
|
31
|
+
amount: @new_receipt.amount,
|
|
32
|
+
contact_name: @new_receipt.contact_name,
|
|
33
|
+
contact_ic: @new_receipt.contact_ic,
|
|
34
|
+
contact_dic: @new_receipt.contact_dic,
|
|
35
|
+
issue_date: @new_receipt.issue_date,
|
|
36
|
+
account_id: @new_receipt.account_id,
|
|
37
|
+
user_id: @new_receipt.user_id }, use_route: :invoice_bar
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
test "should show receipt" do
|
|
42
|
+
get :show, id: @receipt, use_route: :invoice_bar
|
|
43
|
+
assert_response :success
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
test "should get edit" do
|
|
47
|
+
get :edit, id: @receipt, use_route: :invoice_bar
|
|
48
|
+
assert_response :success
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
test "should update receipt" do
|
|
52
|
+
put :update, id: @receipt, receipt: {
|
|
53
|
+
number: @receipt.number,
|
|
54
|
+
amount: @receipt.amount,
|
|
55
|
+
contact_name: @receipt.contact_name,
|
|
56
|
+
contact_ic: @receipt.contact_ic,
|
|
57
|
+
contact_dic: @receipt.contact_dic,
|
|
58
|
+
issue_date: @receipt.issue_date,
|
|
59
|
+
account_id: @receipt.account_id,
|
|
60
|
+
user_id: @receipt.user_id }, use_route: :invoice_bar
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
test "should destroy receipt" do
|
|
64
|
+
assert_difference('InvoiceBar::Receipt.count', -1) do
|
|
65
|
+
delete :destroy, id: @receipt, use_route: :invoice_bar
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::UsersControllerTest < ActionController::TestCase
|
|
6
|
+
setup do
|
|
7
|
+
@user = FactoryGirl.create(:invoice_bar_user, administrator: true)
|
|
8
|
+
|
|
9
|
+
login_user
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
test "should get index" do
|
|
13
|
+
get :index, use_route: :invoice_bar
|
|
14
|
+
assert_response :success
|
|
15
|
+
assert_not_nil assigns(:users)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
test "should get new" do
|
|
19
|
+
get :new, use_route: :invoice_bar
|
|
20
|
+
assert_response :success
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
test "should create user" do
|
|
24
|
+
@new_user = FactoryGirl.build(:invoice_bar_user)
|
|
25
|
+
|
|
26
|
+
assert_difference('InvoiceBar::User.count') do
|
|
27
|
+
post :create, user: {
|
|
28
|
+
name: @new_user.name,
|
|
29
|
+
email: @new_user.email,
|
|
30
|
+
ic: @new_user.ic,
|
|
31
|
+
crypted_password: @new_user.crypted_password,
|
|
32
|
+
phone: @new_user.phone,
|
|
33
|
+
remember_me_token: @new_user.remember_me_token,
|
|
34
|
+
remember_me_token_expires_at: @new_user.remember_me_token_expires_at,
|
|
35
|
+
reset_password_email_sent_at: @new_user.reset_password_email_sent_at,
|
|
36
|
+
reset_password_token: @new_user.reset_password_token,
|
|
37
|
+
reset_password_token_expires_at: @new_user.reset_password_token_expires_at,
|
|
38
|
+
salt: @new_user.salt,
|
|
39
|
+
web: @new_user.web,
|
|
40
|
+
address_attributes: {
|
|
41
|
+
street: @new_user.street,
|
|
42
|
+
street_number: @new_user.street_number,
|
|
43
|
+
postcode: @new_user.postcode,
|
|
44
|
+
city: @new_user.city,
|
|
45
|
+
city_part: @new_user.city_part,
|
|
46
|
+
extra_address_line: @new_user.extra_address_line }}, use_route: :invoice_bar
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
test "should show user" do
|
|
51
|
+
get :show, id: @user, use_route: :invoice_bar
|
|
52
|
+
assert_response :success
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
test "should update user" do
|
|
56
|
+
put :update, id: @user, user: {
|
|
57
|
+
name: @user.name,
|
|
58
|
+
email: @user.email,
|
|
59
|
+
ic: @user.ic,
|
|
60
|
+
crypted_password: @user.crypted_password,
|
|
61
|
+
phone: @user.phone,
|
|
62
|
+
remember_me_token: @user.remember_me_token,
|
|
63
|
+
remember_me_token_expires_at: @user.remember_me_token_expires_at,
|
|
64
|
+
reset_password_email_sent_at: @user.reset_password_email_sent_at,
|
|
65
|
+
reset_password_token: @user.reset_password_token,
|
|
66
|
+
reset_password_token_expires_at: @user.reset_password_token_expires_at,
|
|
67
|
+
salt: @user.salt,
|
|
68
|
+
web: @user.web,
|
|
69
|
+
address_attributes: {
|
|
70
|
+
street: @user.street,
|
|
71
|
+
street_number: @user.street_number,
|
|
72
|
+
postcode: @user.postcode,
|
|
73
|
+
city: @user.city,
|
|
74
|
+
city_part: @user.city_part,
|
|
75
|
+
extra_address_line: @user.extra_address_line }}, use_route: :invoice_bar
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
test "should destroy user" do
|
|
79
|
+
assert_difference('InvoiceBar::User.count', -1) do
|
|
80
|
+
delete :destroy, id: @user, use_route: :invoice_bar
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
require 'test_helper'
|
|
3
|
+
require 'rails/performance_test_help'
|
|
4
|
+
|
|
5
|
+
class BrowsingTest < ActionDispatch::PerformanceTest
|
|
6
|
+
# Refer to the documentation for all available options
|
|
7
|
+
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
|
|
8
|
+
# :output => 'tmp/performance', :formats => [:flat] }
|
|
9
|
+
|
|
10
|
+
def test_homepage
|
|
11
|
+
get '/'
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
=end
|
data/test/test_helper.rb
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Configure Rails Environment
|
|
2
|
+
ENV["RAILS_ENV"] = 'test'
|
|
3
|
+
|
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
|
5
|
+
require 'rails/test_help'
|
|
6
|
+
|
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
|
8
|
+
|
|
9
|
+
# Load support files
|
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
11
|
+
|
|
12
|
+
# Show queries
|
|
13
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
|
14
|
+
|
|
15
|
+
require 'shoulda'
|
|
16
|
+
require 'faker'
|
|
17
|
+
require 'factory_girl'
|
|
18
|
+
FactoryGirl.find_definitions
|
|
19
|
+
|
|
20
|
+
class ActiveSupport::TestCase
|
|
21
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
|
22
|
+
#
|
|
23
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
|
24
|
+
# -- they do not yet inherit this setting
|
|
25
|
+
#fixtures :all
|
|
26
|
+
|
|
27
|
+
# Add more helper methods to be used by all tests here...
|
|
28
|
+
include FactoryGirl::Syntax::Methods
|
|
29
|
+
include Sorcery::TestHelpers::Rails
|
|
30
|
+
|
|
31
|
+
FactoryGirl.define do
|
|
32
|
+
sequence(:invoice_bar_name) { |n| "Name #{hash[n]}9" }
|
|
33
|
+
sequence(:invoice_bar_email) { |n| "#{hash[n]}#{n}#{n}abc9@email.cz" }
|
|
34
|
+
sequence(:invoice_bar_ic) { |n| "#{n}78974" }
|
|
35
|
+
sequence(:invoice_bar_amount) { |n| "#{n}" }
|
|
36
|
+
sequence(:invoice_bar_invoice_number) { |n| "20100112#{n}" }
|
|
37
|
+
sequence(:invoice_bar_currency_name) { |n| "kc#{n}" }
|
|
38
|
+
sequence(:invoice_bar_currency_symbol) { |n| "k#{n}" }
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::AccountTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :name
|
|
7
|
+
should allow_mass_assignment_of :bank_account_number
|
|
8
|
+
should allow_mass_assignment_of :iban
|
|
9
|
+
should allow_mass_assignment_of :swift
|
|
10
|
+
should allow_mass_assignment_of :amount
|
|
11
|
+
should validate_presence_of :name
|
|
12
|
+
should validate_presence_of :amount
|
|
13
|
+
should validate_presence_of :user_id
|
|
14
|
+
should validate_presence_of :currency_id
|
|
15
|
+
should ensure_length_of(:iban).is_at_least(15).is_at_most(34)
|
|
16
|
+
should ensure_length_of(:swift).is_at_least(8).is_at_most(11)
|
|
17
|
+
should belong_to :currency
|
|
18
|
+
should belong_to :user
|
|
19
|
+
|
|
20
|
+
test "account should validate uniqueness of name" do
|
|
21
|
+
user = FactoryGirl.create(:invoice_bar_user)
|
|
22
|
+
account = FactoryGirl.create(:invoice_bar_account, name: 'name', user: user)
|
|
23
|
+
new_account = FactoryGirl.build(:invoice_bar_account, name: 'name', user: user)
|
|
24
|
+
|
|
25
|
+
assert_equal false, new_account.valid?
|
|
26
|
+
|
|
27
|
+
new_account = FactoryGirl.build(:invoice_bar_account, user: user)
|
|
28
|
+
|
|
29
|
+
assert_equal true, new_account.valid?
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::AddressTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :city
|
|
7
|
+
should allow_mass_assignment_of :city_part
|
|
8
|
+
should allow_mass_assignment_of :street
|
|
9
|
+
should allow_mass_assignment_of :street_number
|
|
10
|
+
should allow_mass_assignment_of :postcode
|
|
11
|
+
should allow_mass_assignment_of :extra_address_line
|
|
12
|
+
should validate_presence_of :city
|
|
13
|
+
should validate_presence_of :street
|
|
14
|
+
should validate_presence_of :street_number
|
|
15
|
+
should validate_presence_of :postcode
|
|
16
|
+
should belong_to :addressable
|
|
17
|
+
should allow_mass_assignment_of :addressable_id
|
|
18
|
+
should allow_mass_assignment_of :addressable_type
|
|
19
|
+
|
|
20
|
+
test "address should create a copy of self" do
|
|
21
|
+
address = FactoryGirl.build(:invoice_bar_address)
|
|
22
|
+
copy = address.copy
|
|
23
|
+
|
|
24
|
+
assert_equal address.street, copy.street
|
|
25
|
+
assert_equal address.street_number, copy.street_number
|
|
26
|
+
assert_equal address.city, copy.city
|
|
27
|
+
assert_equal address.city_part, copy.city_part
|
|
28
|
+
assert_equal address.postcode, copy.postcode
|
|
29
|
+
assert_equal address.extra_address_line, copy.extra_address_line
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::ContactTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :ic
|
|
7
|
+
should allow_mass_assignment_of :dic
|
|
8
|
+
should allow_mass_assignment_of :bank_account
|
|
9
|
+
should allow_mass_assignment_of :email
|
|
10
|
+
should allow_mass_assignment_of :phone
|
|
11
|
+
should allow_mass_assignment_of :web
|
|
12
|
+
should accept_nested_attributes_for :address
|
|
13
|
+
should validate_presence_of :name
|
|
14
|
+
should validate_presence_of :user_id
|
|
15
|
+
should ensure_length_of(:dic).is_at_least(4).is_at_most(14)
|
|
16
|
+
should belong_to :user
|
|
17
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::CurrencyTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :name
|
|
7
|
+
should allow_mass_assignment_of :symbol
|
|
8
|
+
should allow_mass_assignment_of :priority
|
|
9
|
+
should validate_presence_of :name
|
|
10
|
+
should validate_presence_of :symbol
|
|
11
|
+
should validate_presence_of :priority
|
|
12
|
+
should ensure_length_of(:symbol).is_at_most(3)
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBarHelperTest < ActionView::TestCase
|
|
6
|
+
include InvoiceBar::InvoiceBarHelper
|
|
7
|
+
|
|
8
|
+
test "should define active state for controller" do
|
|
9
|
+
params[:controller] = 'invoice_bar/invoices'
|
|
10
|
+
|
|
11
|
+
assert_equal 'active', active_for_controller('invoices')
|
|
12
|
+
assert_not_equal 'active', active_for_controller('receipts')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
test "should format postcode" do
|
|
16
|
+
assert_equal '747 27', formatted_postcode('74727')
|
|
17
|
+
assert_equal '747 35', formatted_postcode('74735')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::InvoiceTemplateTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :contact_name
|
|
7
|
+
should allow_mass_assignment_of :contact_ic
|
|
8
|
+
should allow_mass_assignment_of :contact_dic
|
|
9
|
+
should allow_mass_assignment_of :name
|
|
10
|
+
should allow_mass_assignment_of :payment_identification_number
|
|
11
|
+
should allow_mass_assignment_of :amount
|
|
12
|
+
should allow_mass_assignment_of :issue_date
|
|
13
|
+
should allow_mass_assignment_of :due_date
|
|
14
|
+
should allow_mass_assignment_of :account_id
|
|
15
|
+
should allow_mass_assignment_of :user_id
|
|
16
|
+
should allow_mass_assignment_of :address
|
|
17
|
+
should allow_mass_assignment_of :address_attributes
|
|
18
|
+
should allow_mass_assignment_of :items_attributes
|
|
19
|
+
should validate_presence_of :name
|
|
20
|
+
should accept_nested_attributes_for :address
|
|
21
|
+
should accept_nested_attributes_for :items
|
|
22
|
+
should have_one(:address).dependent(:destroy)
|
|
23
|
+
should have_many(:items).dependent(:destroy)
|
|
24
|
+
|
|
25
|
+
test "invoice template should validate uniqueness of name" do
|
|
26
|
+
user = FactoryGirl.create(:invoice_bar_user)
|
|
27
|
+
invoice_template = FactoryGirl.create(:invoice_bar_invoice_template, name: 'name', user: user)
|
|
28
|
+
new_invoice_template = FactoryGirl.build(:invoice_bar_invoice_template, name: 'name', user: user)
|
|
29
|
+
|
|
30
|
+
assert_equal false, new_invoice_template.valid?
|
|
31
|
+
|
|
32
|
+
new_invoice_template = FactoryGirl.build(:invoice_bar_invoice_template, user: user)
|
|
33
|
+
|
|
34
|
+
assert_equal true, new_invoice_template.valid?
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::InvoiceTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :contact_name
|
|
7
|
+
should allow_mass_assignment_of :contact_ic
|
|
8
|
+
should allow_mass_assignment_of :contact_dic
|
|
9
|
+
should allow_mass_assignment_of :number
|
|
10
|
+
should allow_mass_assignment_of :payment_identification_number
|
|
11
|
+
should allow_mass_assignment_of :amount
|
|
12
|
+
should allow_mass_assignment_of :issue_date
|
|
13
|
+
should allow_mass_assignment_of :due_date
|
|
14
|
+
should allow_mass_assignment_of :sent
|
|
15
|
+
should allow_mass_assignment_of :paid
|
|
16
|
+
should allow_mass_assignment_of :account_id
|
|
17
|
+
should allow_mass_assignment_of :user_id
|
|
18
|
+
should allow_mass_assignment_of :address
|
|
19
|
+
should allow_mass_assignment_of :address_attributes
|
|
20
|
+
should allow_mass_assignment_of :items_attributes
|
|
21
|
+
should accept_nested_attributes_for :address
|
|
22
|
+
should accept_nested_attributes_for :items
|
|
23
|
+
should have_one(:address).dependent(:destroy)
|
|
24
|
+
should have_many(:items).dependent(:destroy)
|
|
25
|
+
|
|
26
|
+
test "invoice should validate uniqueness of number" do
|
|
27
|
+
user = FactoryGirl.create(:invoice_bar_user)
|
|
28
|
+
invoice = FactoryGirl.create(:invoice_bar_invoice, number: '2', user: user)
|
|
29
|
+
new_invoice = FactoryGirl.build(:invoice_bar_invoice, number: '2', user: user)
|
|
30
|
+
|
|
31
|
+
assert_equal false, new_invoice.valid?
|
|
32
|
+
|
|
33
|
+
new_invoice = FactoryGirl.build(:invoice_bar_invoice, user: user)
|
|
34
|
+
|
|
35
|
+
assert_equal true, new_invoice.valid?
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
test "invoice should be marked as paid" do
|
|
39
|
+
invoice = FactoryGirl.create(:invoice_bar_invoice)
|
|
40
|
+
invoice.mark_as_paid
|
|
41
|
+
|
|
42
|
+
assert_equal true, invoice.paid
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
test "invoice should be marked as sent" do
|
|
46
|
+
invoice = FactoryGirl.create(:invoice_bar_invoice)
|
|
47
|
+
invoice.mark_as_sent
|
|
48
|
+
|
|
49
|
+
assert_equal true, invoice.sent
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
test "invoice should apply template" do
|
|
53
|
+
invoice_template = FactoryGirl.build(:invoice_bar_filled_invoice_template)
|
|
54
|
+
orig_invoice = FactoryGirl.build(:invoice_bar_incomplete_invoice)
|
|
55
|
+
invoice = FactoryGirl.build(:invoice_bar_incomplete_invoice)
|
|
56
|
+
invoice.apply_template(invoice_template)
|
|
57
|
+
|
|
58
|
+
assert_equal orig_invoice.contact_name, invoice.contact_name
|
|
59
|
+
assert_equal orig_invoice.contact_ic, invoice.contact_ic
|
|
60
|
+
assert_equal Date.yesterday, invoice.issue_date
|
|
61
|
+
assert_not_equal invoice_template.contact_dic, invoice.contact_dic
|
|
62
|
+
assert_not_equal orig_invoice.issue_date, invoice.issue_date
|
|
63
|
+
assert_not_equal orig_invoice.due_date, invoice.due_date
|
|
64
|
+
assert_equal orig_invoice.address_city, invoice.address_city
|
|
65
|
+
assert_equal orig_invoice.address_street, invoice.address_street
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::ItemTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :name
|
|
7
|
+
should allow_mass_assignment_of :number
|
|
8
|
+
should allow_mass_assignment_of :price
|
|
9
|
+
should allow_mass_assignment_of :unit
|
|
10
|
+
should_not allow_mass_assignment_of :amount
|
|
11
|
+
should validate_presence_of :name
|
|
12
|
+
should belong_to :itemable
|
|
13
|
+
should allow_mass_assignment_of :itemable_id
|
|
14
|
+
should allow_mass_assignment_of :itemable_type
|
|
15
|
+
|
|
16
|
+
test "item should create a copy of self" do
|
|
17
|
+
item = FactoryGirl.build(:invoice_bar_item)
|
|
18
|
+
copy = item.copy
|
|
19
|
+
|
|
20
|
+
assert_equal item.name, copy.name
|
|
21
|
+
assert_equal item.number, copy.number
|
|
22
|
+
assert_equal item.price, copy.price
|
|
23
|
+
assert_equal item.unit, copy.unit
|
|
24
|
+
assert_equal item.amount, copy.amount
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "should count total amount for item" do
|
|
28
|
+
item = FactoryGirl.build(:invoice_bar_item, :name => 'Item', :price => 100, :number => 5)
|
|
29
|
+
|
|
30
|
+
item.update_amount
|
|
31
|
+
|
|
32
|
+
assert_equal 500, item.amount
|
|
33
|
+
|
|
34
|
+
item.price = 100
|
|
35
|
+
item.number = 10
|
|
36
|
+
|
|
37
|
+
assert_equal 1000, item.total
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
test "should show human price " do
|
|
41
|
+
item = FactoryGirl.build(:invoice_bar_item, :name => 'Item', :price => 100, :number => 5)
|
|
42
|
+
|
|
43
|
+
item.update_amount
|
|
44
|
+
|
|
45
|
+
assert_equal FormattedMoney.amount(100), item.human_price
|
|
46
|
+
assert_equal FormattedMoney.amount(500), item.human_amount
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::ReceiptTemplateTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :contact_name
|
|
7
|
+
should allow_mass_assignment_of :contact_ic
|
|
8
|
+
should allow_mass_assignment_of :contact_dic
|
|
9
|
+
should allow_mass_assignment_of :name
|
|
10
|
+
should allow_mass_assignment_of :amount
|
|
11
|
+
should allow_mass_assignment_of :issue_date
|
|
12
|
+
should allow_mass_assignment_of :account_id
|
|
13
|
+
should allow_mass_assignment_of :user_id
|
|
14
|
+
should allow_mass_assignment_of :address
|
|
15
|
+
should allow_mass_assignment_of :address_attributes
|
|
16
|
+
should allow_mass_assignment_of :items_attributes
|
|
17
|
+
should validate_presence_of :name
|
|
18
|
+
should accept_nested_attributes_for :address
|
|
19
|
+
should accept_nested_attributes_for :items
|
|
20
|
+
should have_one(:address).dependent(:destroy)
|
|
21
|
+
should have_many(:items).dependent(:destroy)
|
|
22
|
+
|
|
23
|
+
test "receipt template should validate uniqueness of name" do
|
|
24
|
+
user = FactoryGirl.create(:invoice_bar_user)
|
|
25
|
+
receipt_template = FactoryGirl.create(:invoice_bar_receipt_template, name: 'name', user: user)
|
|
26
|
+
new_receipt_template = FactoryGirl.build(:invoice_bar_receipt_template, name: 'name', user: user)
|
|
27
|
+
|
|
28
|
+
assert_equal false, new_receipt_template.valid?
|
|
29
|
+
|
|
30
|
+
new_receipt_template = FactoryGirl.build(:invoice_bar_receipt_template, user: user)
|
|
31
|
+
|
|
32
|
+
assert_equal true, new_receipt_template.valid?
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::ReceiptTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :contact_name
|
|
7
|
+
should allow_mass_assignment_of :contact_ic
|
|
8
|
+
should allow_mass_assignment_of :contact_dic
|
|
9
|
+
should allow_mass_assignment_of :number
|
|
10
|
+
should allow_mass_assignment_of :amount
|
|
11
|
+
should allow_mass_assignment_of :issue_date
|
|
12
|
+
should allow_mass_assignment_of :account_id
|
|
13
|
+
should allow_mass_assignment_of :user_id
|
|
14
|
+
should allow_mass_assignment_of :address
|
|
15
|
+
should allow_mass_assignment_of :address_attributes
|
|
16
|
+
should allow_mass_assignment_of :items_attributes
|
|
17
|
+
should accept_nested_attributes_for :address
|
|
18
|
+
should accept_nested_attributes_for :items
|
|
19
|
+
should have_one(:address).dependent(:destroy)
|
|
20
|
+
should have_many(:items).dependent(:destroy)
|
|
21
|
+
|
|
22
|
+
test "receipt should validate uniqueness of number" do
|
|
23
|
+
user = FactoryGirl.create(:invoice_bar_user)
|
|
24
|
+
receipt = FactoryGirl.create(:invoice_bar_receipt, number: '2', user: user)
|
|
25
|
+
new_receipt = FactoryGirl.build(:invoice_bar_receipt, number: '2', user: user)
|
|
26
|
+
|
|
27
|
+
assert_equal false, new_receipt.valid?
|
|
28
|
+
|
|
29
|
+
new_receipt = FactoryGirl.build(:invoice_bar_receipt, user: user)
|
|
30
|
+
|
|
31
|
+
assert_equal true, new_receipt.valid?
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
test "receipt should apply template" do
|
|
35
|
+
receipt_template = FactoryGirl.build(:invoice_bar_filled_receipt_template)
|
|
36
|
+
orig_receipt = FactoryGirl.build(:invoice_bar_incomplete_receipt)
|
|
37
|
+
receipt = FactoryGirl.build(:invoice_bar_incomplete_receipt)
|
|
38
|
+
receipt.apply_template(receipt_template)
|
|
39
|
+
|
|
40
|
+
assert_equal orig_receipt.contact_name, receipt.contact_name
|
|
41
|
+
assert_equal orig_receipt.contact_ic, receipt.contact_ic
|
|
42
|
+
assert_equal Date.yesterday, receipt.issue_date
|
|
43
|
+
assert_not_equal receipt_template.contact_dic, receipt.contact_dic
|
|
44
|
+
assert_not_equal orig_receipt.issue_date, receipt.issue_date
|
|
45
|
+
assert_equal orig_receipt.address_city, receipt.address_city
|
|
46
|
+
assert_equal orig_receipt.address_street, receipt.address_street
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class InvoiceBar::UserTest < ActiveSupport::TestCase
|
|
6
|
+
should allow_mass_assignment_of :name
|
|
7
|
+
should allow_mass_assignment_of :ic
|
|
8
|
+
should allow_mass_assignment_of :email
|
|
9
|
+
should allow_mass_assignment_of :phone
|
|
10
|
+
should allow_mass_assignment_of :web
|
|
11
|
+
should allow_mass_assignment_of :password
|
|
12
|
+
should allow_mass_assignment_of :crypted_password
|
|
13
|
+
should allow_mass_assignment_of :salt
|
|
14
|
+
should allow_mass_assignment_of :remember_me_token
|
|
15
|
+
should allow_mass_assignment_of :remember_me_token_expires_at
|
|
16
|
+
should allow_mass_assignment_of :reset_password_email_sent_at
|
|
17
|
+
should allow_mass_assignment_of :reset_password_token
|
|
18
|
+
should allow_mass_assignment_of :reset_password_token_expires_at
|
|
19
|
+
should allow_mass_assignment_of :address_attributes
|
|
20
|
+
should validate_presence_of :name
|
|
21
|
+
should validate_presence_of :ic
|
|
22
|
+
should validate_presence_of :email
|
|
23
|
+
should accept_nested_attributes_for :address
|
|
24
|
+
should have_one(:address).dependent(:destroy)
|
|
25
|
+
should have_many(:accounts).dependent(:destroy)
|
|
26
|
+
should have_many(:contacts).dependent(:destroy)
|
|
27
|
+
should have_many(:invoices).dependent(:destroy)
|
|
28
|
+
should have_many(:invoice_templates).dependent(:destroy)
|
|
29
|
+
end
|