office_clerk 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +15 -0
  3. data/Gemfile +0 -13
  4. data/Gemfile.lock +50 -83
  5. data/Guardfile +28 -0
  6. data/app/controllers/admin_controller.rb +6 -2
  7. data/app/controllers/baskets_controller.rb +2 -1
  8. data/app/controllers/categories_controller.rb +2 -1
  9. data/app/controllers/office_controller.rb +5 -0
  10. data/app/controllers/products_controller.rb +1 -1
  11. data/app/controllers/sessions_controller.rb +5 -0
  12. data/app/helpers/shop_helper.rb +0 -11
  13. data/app/models/basket.rb +2 -2
  14. data/app/models/clerk.rb +1 -3
  15. data/app/models/order.rb +3 -3
  16. data/app/views/baskets/_small.html.haml +1 -0
  17. data/app/views/baskets/index.html.haml +3 -3
  18. data/app/views/baskets/show.html.haml +1 -2
  19. data/app/views/categories/edit.html.haml +2 -1
  20. data/app/views/categories/index.html.haml +19 -8
  21. data/app/views/categories/show.html.haml +31 -26
  22. data/app/views/clerks/index.html.haml +4 -4
  23. data/app/views/layouts/_header_extra.haml +1 -2
  24. data/app/views/layouts/office_clerk.csv.erb +1 -0
  25. data/app/views/order_mailer/cancel.text.erb +24 -0
  26. data/app/views/order_mailer/confirm.text.erb +36 -0
  27. data/app/views/order_mailer/paid.text.erb +28 -0
  28. data/app/views/order_mailer/shipped.text.erb +24 -0
  29. data/app/views/orders/index.csv.erb +5 -0
  30. data/app/views/orders/index.html.haml +39 -45
  31. data/app/views/orders/show.html.haml +23 -11
  32. data/app/views/products/_triple.html.haml +2 -2
  33. data/app/views/products/index.html.haml +37 -19
  34. data/app/views/purchases/index.html.haml +4 -3
  35. data/app/views/shop/_product_box.haml +12 -12
  36. data/app/views/suppliers/index.html.haml +5 -5
  37. data/bin/rake +0 -4
  38. data/bin/rspec +0 -4
  39. data/config/locales/en.yml +5 -0
  40. data/config/locales/fi.yml +5 -0
  41. data/config/spring.rb +1 -0
  42. data/lib/office_clerk.rb +3 -1
  43. data/lib/office_clerk/engine.rb +5 -1
  44. data/lib/office_clerk/shipping_method.rb +1 -1
  45. data/lib/office_clerk/version.rb +1 -1
  46. data/office_clerk.gemspec +3 -1
  47. data/spec/features/categories_search_spec.rb +47 -0
  48. data/spec/features/products/index_spec.rb +58 -9
  49. data/spec/models/clerk/email_spec.rb +4 -4
  50. data/spec/spec_helper.rb +6 -47
  51. data/spec/support/basket_helper.rb +9 -0
  52. data/spec/support/product_helper.rb +25 -0
  53. data/spec/support/request_helper.rb +4 -4
  54. data/spec/support/setup/admin.rb +4 -0
  55. data/spec/support/setup/capybara.rb +14 -0
  56. data/spec/support/setup/cleaner.rb +22 -0
  57. data/spec/support/setup/email.rb +6 -0
  58. data/spec/support/setup/factory_girl.rb +3 -0
  59. metadata +95 -51
  60. data/app/views/order_mailer/cancel.html.haml +0 -6
  61. data/app/views/order_mailer/confirm.html.haml +0 -7
  62. data/app/views/order_mailer/paid.html.haml +0 -6
  63. data/app/views/order_mailer/shipped.html.haml +0 -6
  64. data/config/i18n-tasks.yml +0 -11
  65. data/spec/support/factory_girl.rb +0 -6
  66. data/test_app/spec/rails_helper.rb +0 -50
  67. data/test_app/spec/spec_helper.rb +0 -85
@@ -1,6 +0,0 @@
1
- Hi
2
-
3
- we cancelled your order of
4
- =@order.total_price
5
-
6
-
@@ -1,7 +0,0 @@
1
- Hi
2
-
3
- please pay the sum of
4
- =@order.total_price
5
-
6
- NOW
7
-
@@ -1,6 +0,0 @@
1
- Hi
2
-
3
- we received payment for
4
- =@order.total_price
5
-
6
-
@@ -1,6 +0,0 @@
1
- Hi
2
-
3
- we shipped your order
4
- =@order.total_price
5
-
6
-
@@ -1,11 +0,0 @@
1
- base_locale: fi
2
- locales: [fi]
3
- data:
4
- # a list of file globs to read from per-locale
5
- read:
6
- # add this one to also read from namespaced files, e.g. simple_form.en.yml:
7
- - 'config/locales/*.%{locale}.yml'
8
- # a list of {key pattern => file} routes, matched top to bottom
9
- write:
10
- # this is the default catch-all:
11
- - 'config/locales/office.%{locale}.yml' # path is short for ['*', path]
@@ -1,6 +0,0 @@
1
- ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
2
- Dir[File.join(ENGINE_RAILS_ROOT, "../spec/factories/**/*.rb")].each {|f| require f }
3
-
4
- RSpec.configure do |config|
5
- config.include FactoryGirl::Syntax::Methods
6
- end
@@ -1,50 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV["RAILS_ENV"] ||= 'test'
3
- require 'spec_helper'
4
- require File.expand_path("../../config/environment", __FILE__)
5
- require 'rspec/rails'
6
- # Add additional requires below this line. Rails is not loaded until this point!
7
-
8
- # Requires supporting ruby files with custom matchers and macros, etc, in
9
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
10
- # run as spec files by default. This means that files in spec/support that end
11
- # in _spec.rb will both be required and run as specs, causing the specs to be
12
- # run twice. It is recommended that you do not name files matching this glob to
13
- # end with _spec.rb. You can configure this pattern with the --pattern
14
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
15
- #
16
- # The following line is provided for convenience purposes. It has the downside
17
- # of increasing the boot-up time by auto-requiring all files in the support
18
- # directory. Alternatively, in the individual `*_spec.rb` files, manually
19
- # require only the support files necessary.
20
- #
21
- # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
22
-
23
- # Checks for pending migrations before tests are run.
24
- # If you are not using ActiveRecord, you can remove this line.
25
- ActiveRecord::Migration.check_pending!
26
-
27
- RSpec.configure do |config|
28
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
29
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
30
-
31
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
32
- # examples within a transaction, remove the following line or assign false
33
- # instead of true.
34
- config.use_transactional_fixtures = true
35
-
36
- # RSpec Rails can automatically mix in different behaviours to your tests
37
- # based on their file location, for example enabling you to call `get` and
38
- # `post` in specs under `spec/controllers`.
39
- #
40
- # You can disable this behaviour by removing the line below, and instead
41
- # explicitly tag your specs with their type, e.g.:
42
- #
43
- # RSpec.describe UsersController, :type => :controller do
44
- # # ...
45
- # end
46
- #
47
- # The different available types are documented in the features, such as in
48
- # https://relishapp.com/rspec/rspec-rails/docs
49
- config.infer_spec_type_from_file_location!
50
- end
@@ -1,85 +0,0 @@
1
- # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
- # file to always be loaded, without a need to explicitly require it in any files.
5
- #
6
- # Given that it is always loaded, you are encouraged to keep this file as
7
- # light-weight as possible. Requiring heavyweight dependencies from this file
8
- # will add to the boot time of your test suite on EVERY test run, even for an
9
- # individual file that may not need all of that loaded. Instead, consider making
10
- # a separate helper file that requires the additional dependencies and performs
11
- # the additional setup, and require it from the spec files that actually need it.
12
- #
13
- # The `.rspec` file also contains a few flags that are not defaults but that
14
- # users commonly want.
15
- #
16
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
- RSpec.configure do |config|
18
- # rspec-expectations config goes here. You can use an alternate
19
- # assertion/expectation library such as wrong or the stdlib/minitest
20
- # assertions if you prefer.
21
- config.expect_with :rspec do |expectations|
22
- # This option will default to `true` in RSpec 4. It makes the `description`
23
- # and `failure_message` of custom matchers include text for helper methods
24
- # defined using `chain`, e.g.:
25
- # be_bigger_than(2).and_smaller_than(4).description
26
- # # => "be bigger than 2 and smaller than 4"
27
- # ...rather than:
28
- # # => "be bigger than 2"
29
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
30
- end
31
-
32
- # rspec-mocks config goes here. You can use an alternate test double
33
- # library (such as bogus or mocha) by changing the `mock_with` option here.
34
- config.mock_with :rspec do |mocks|
35
- # Prevents you from mocking or stubbing a method that does not exist on
36
- # a real object. This is generally recommended, and will default to
37
- # `true` in RSpec 4.
38
- mocks.verify_partial_doubles = true
39
- end
40
-
41
- # The settings below are suggested to provide a good initial experience
42
- # with RSpec, but feel free to customize to your heart's content.
43
- =begin
44
- # These two settings work together to allow you to limit a spec run
45
- # to individual examples or groups you care about by tagging them with
46
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
47
- # get run.
48
- config.filter_run :focus
49
- config.run_all_when_everything_filtered = true
50
-
51
- # Limits the available syntax to the non-monkey patched syntax that is recommended.
52
- # For more details, see:
53
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56
- config.disable_monkey_patching!
57
-
58
- # Many RSpec users commonly either run the entire suite or an individual
59
- # file, and it's useful to allow more verbose output when running an
60
- # individual spec file.
61
- if config.files_to_run.one?
62
- # Use the documentation formatter for detailed output,
63
- # unless a formatter has already been configured
64
- # (e.g. via a command-line flag).
65
- config.default_formatter = 'doc'
66
- end
67
-
68
- # Print the 10 slowest examples and example groups at the
69
- # end of the spec run, to help surface which specs are running
70
- # particularly slow.
71
- config.profile_examples = 10
72
-
73
- # Run specs in random order to surface order dependencies. If you find an
74
- # order dependency and want to debug it, you can fix the order by providing
75
- # the seed, which is printed after each run.
76
- # --seed 1234
77
- config.order = :random
78
-
79
- # Seed global randomization in this process using the `--seed` CLI option.
80
- # Setting this allows you to use `--seed` to deterministically reproduce
81
- # test failures related to randomization by passing the same `--seed` value
82
- # as the one that triggered the failure.
83
- Kernel.srand config.seed
84
- =end
85
- end