cmor_galleries 0.0.1.pre

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 +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +44 -0
  4. data/Rakefile +19 -0
  5. data/app/assets/config/cmor_galleries_manifest.js +2 -0
  6. data/app/assets/javascripts/cmor/galleries/application/keep.js +0 -0
  7. data/app/assets/javascripts/cmor/galleries/application.js +14 -0
  8. data/app/assets/stylesheets/cmor/galleries/application/keep.css +0 -0
  9. data/app/assets/stylesheets/cmor/galleries/application.css +15 -0
  10. data/app/controllers/cmor/galleries/application_controller.rb +5 -0
  11. data/app/controllers/cmor/galleries/application_resources_controller.rb +11 -0
  12. data/app/controllers/cmor/galleries/picture_galleries_controller.rb +17 -0
  13. data/app/models/cmor/galleries/application_record.rb +5 -0
  14. data/app/models/cmor/galleries/picture_detail.rb +26 -0
  15. data/app/models/cmor/galleries/picture_gallery.rb +88 -0
  16. data/app/view_helpers/cmor/galleries/galleries_helper.rb +34 -0
  17. data/app/view_helpers/cmor/galleries/pictures_helper.rb +37 -0
  18. data/app/views/cmor/galleries/galleries_helper/_render.html.haml +17 -0
  19. data/app/views/cmor/galleries/picture_galleries/index.html.haml +16 -0
  20. data/app/views/cmor/galleries/picture_galleries/show.html.haml +18 -0
  21. data/app/views/cmor/galleries/pictures_helper/_render.html.haml +15 -0
  22. data/app/views/layouts/cmor/galleries/application.html.erb +14 -0
  23. data/config/initializers/assets.rb +1 -0
  24. data/config/locales/de.yml +48 -0
  25. data/config/locales/en.yml +46 -0
  26. data/config/routes.rb +9 -0
  27. data/db/migrate/20180301153325_create_cmor_galleries_picture_galleries.rb +11 -0
  28. data/db/migrate/20180302082402_create_cmor_galleries_picture_details.rb +14 -0
  29. data/lib/cmor/galleries/configuration.rb +12 -0
  30. data/lib/cmor/galleries/engine.rb +13 -0
  31. data/lib/cmor/galleries/version.rb +7 -0
  32. data/lib/cmor/galleries.rb +10 -0
  33. data/lib/cmor_galleries.rb +7 -0
  34. data/lib/generators/cmor/galleries/install/install_generator.rb +24 -0
  35. data/lib/generators/cmor/galleries/install/templates/initializer.rb +27 -0
  36. data/lib/generators/cmor/galleries/install/templates/routes.source +3 -0
  37. data/lib/tasks/cmor_galleries_tasks.rake +4 -0
  38. data/spec/dummy/config/initializers/cmor_galleries.rb +27 -0
  39. data/spec/dummy/config/initializers/i18n.rb +2 -0
  40. data/spec/dummy/db/development.sqlite3 +0 -0
  41. data/spec/dummy/db/migrate/20190325174835_create_active_storage_tables.active_storage.rb +27 -0
  42. data/spec/dummy/db/migrate/20190325174856_create_cmor_galleries_picture_galleries.cmor_galleries.rb +12 -0
  43. data/spec/dummy/db/migrate/20190325174857_create_cmor_galleries_picture_details.cmor_galleries.rb +15 -0
  44. data/spec/dummy/db/test.sqlite3 +0 -0
  45. data/spec/dummy/log/development.log +122 -0
  46. data/spec/dummy/log/test.log +143 -0
  47. data/spec/dummy/tmp/development_secret.txt +1 -0
  48. data/spec/dummy/tmp/storage/B8/o7/B8o7CDJi1ubYmEcP3ZAGkEiM +0 -0
  49. data/spec/dummy/tmp/storage/Hp/aX/HpaXaXSTTBQhyk9pwjiXNpvs +0 -0
  50. data/spec/factories/cmor_galleries_picture_details.rb +17 -0
  51. data/spec/factories/cmor_galleries_picture_galleries.rb +5 -0
  52. data/spec/files/cmor/galleries/picture_details/example.png +0 -0
  53. data/spec/models/cmor/galleries/picture_detail_spec.rb +7 -0
  54. data/spec/models/cmor/galleries/picture_gallery_spec.rb +8 -0
  55. data/spec/models/generic_spec.rb +50 -0
  56. data/spec/models/i18n_spec.rb +41 -0
  57. data/spec/rails_helper.rb +62 -0
  58. data/spec/rails_helper.rb~ +58 -0
  59. data/spec/spec_helper.rb +96 -0
  60. data/spec/spec_helper.rb~ +96 -0
  61. data/spec/support/capybara.rb +1 -0
  62. data/spec/support/factory_bot.rb +5 -0
  63. data/spec/support/rao-shoulda_matchers.rb +5 -0
  64. data/spec/support/shoulda_matchers.rb +8 -0
  65. data/spec/support~/factory_bot_rails.rb +11 -0
  66. data/spec/support~/shoulda_matchers.rb +8 -0
  67. metadata +430 -0
@@ -0,0 +1,62 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ require 'spec_helper'
3
+ ENV['RAILS_ENV'] ||= 'test'
4
+ require File.expand_path('../dummy/config/environment', __FILE__)
5
+ # Prevent database truncation if the environment is production
6
+ abort("The Rails environment is running in production mode!") if Rails.env.production?
7
+ require 'rspec/rails'
8
+ # Add additional requires below this line. Rails is not loaded until this point!
9
+
10
+ # Requires supporting ruby files with custom matchers and macros, etc, in
11
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
12
+ # run as spec files by default. This means that files in spec/support that end
13
+ # in _spec.rb will both be required and run as specs, causing the specs to be
14
+ # run twice. It is recommended that you do not name files matching this glob to
15
+ # end with _spec.rb. You can configure this pattern with the --pattern
16
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
17
+ #
18
+ # The following line is provided for convenience purposes. It has the downside
19
+ # of increasing the boot-up time by auto-requiring all files in the support
20
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
21
+ # require only the support files necessary.
22
+ #
23
+ # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
24
+ Dir[Cmor::Galleries::Engine.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
25
+
26
+ # Checks for pending migrations and applies them before tests are run.
27
+ # If you are not using ActiveRecord, you can remove these lines.
28
+ # begin
29
+ # ActiveRecord::Migration.maintain_test_schema!
30
+ # rescue ActiveRecord::PendingMigrationError => e
31
+ # puts e.to_s.strip
32
+ # exit 1
33
+ # end
34
+ RSpec.configure do |config|
35
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
36
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
37
+
38
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
39
+ # examples within a transaction, remove the following line or assign false
40
+ # instead of true.
41
+ config.use_transactional_fixtures = true
42
+
43
+ # RSpec Rails can automatically mix in different behaviours to your tests
44
+ # based on their file location, for example enabling you to call `get` and
45
+ # `post` in specs under `spec/controllers`.
46
+ #
47
+ # You can disable this behaviour by removing the line below, and instead
48
+ # explicitly tag your specs with their type, e.g.:
49
+ #
50
+ # RSpec.describe UsersController, :type => :controller do
51
+ # # ...
52
+ # end
53
+ #
54
+ # The different available types are documented in the features, such as in
55
+ # https://relishapp.com/rspec/rspec-rails/docs
56
+ config.infer_spec_type_from_file_location!
57
+
58
+ # Filter lines from Rails gems in backtraces.
59
+ config.filter_rails_from_backtrace!
60
+ # arbitrary gems may also be filtered via:
61
+ # config.filter_gems_from_backtrace("gem name")
62
+ end
@@ -0,0 +1,58 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ require 'spec_helper'
3
+ ENV['RAILS_ENV'] ||= 'test'
4
+ require File.expand_path('../dummy/config/environment', __FILE__)
5
+ # Prevent database truncation if the environment is production
6
+ abort("The Rails environment is running in production mode!") if Rails.env.production?
7
+ require 'rspec/rails'
8
+ # Add additional requires below this line. Rails is not loaded until this point!
9
+
10
+ # Requires supporting ruby files with custom matchers and macros, etc, in
11
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
12
+ # run as spec files by default. This means that files in spec/support that end
13
+ # in _spec.rb will both be required and run as specs, causing the specs to be
14
+ # run twice. It is recommended that you do not name files matching this glob to
15
+ # end with _spec.rb. You can configure this pattern with the --pattern
16
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
17
+ #
18
+ # The following line is provided for convenience purposes. It has the downside
19
+ # of increasing the boot-up time by auto-requiring all files in the support
20
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
21
+ # require only the support files necessary.
22
+ #
23
+ # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
24
+ Dir[Cmor::Galleries::Engine.root.join('spec/support/**/*.rb')].each { |f| require f }
25
+
26
+ # Checks for pending migrations and applies them before tests are run.
27
+ # If you are not using ActiveRecord, you can remove this line.
28
+ # ActiveRecord::Migration.maintain_test_schema!
29
+
30
+ RSpec.configure do |config|
31
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
32
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
33
+
34
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
35
+ # examples within a transaction, remove the following line or assign false
36
+ # instead of true.
37
+ config.use_transactional_fixtures = true
38
+
39
+ # RSpec Rails can automatically mix in different behaviours to your tests
40
+ # based on their file location, for example enabling you to call `get` and
41
+ # `post` in specs under `spec/controllers`.
42
+ #
43
+ # You can disable this behaviour by removing the line below, and instead
44
+ # explicitly tag your specs with their type, e.g.:
45
+ #
46
+ # RSpec.describe UsersController, :type => :controller do
47
+ # # ...
48
+ # end
49
+ #
50
+ # The different available types are documented in the features, such as in
51
+ # https://relishapp.com/rspec/rspec-rails/docs
52
+ config.infer_spec_type_from_file_location!
53
+
54
+ # Filter lines from Rails gems in backtraces.
55
+ config.filter_rails_from_backtrace!
56
+ # arbitrary gems may also be filtered via:
57
+ # config.filter_gems_from_backtrace("gem name")
58
+ end
@@ -0,0 +1,96 @@
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
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+ RSpec.configure do |config|
17
+ # rspec-expectations config goes here. You can use an alternate
18
+ # assertion/expectation library such as wrong or the stdlib/minitest
19
+ # assertions if you prefer.
20
+ config.expect_with :rspec do |expectations|
21
+ # This option will default to `true` in RSpec 4. It makes the `description`
22
+ # and `failure_message` of custom matchers include text for helper methods
23
+ # defined using `chain`, e.g.:
24
+ # be_bigger_than(2).and_smaller_than(4).description
25
+ # # => "be bigger than 2 and smaller than 4"
26
+ # ...rather than:
27
+ # # => "be bigger than 2"
28
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
29
+ end
30
+
31
+ # rspec-mocks config goes here. You can use an alternate test double
32
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
33
+ config.mock_with :rspec do |mocks|
34
+ # Prevents you from mocking or stubbing a method that does not exist on
35
+ # a real object. This is generally recommended, and will default to
36
+ # `true` in RSpec 4.
37
+ mocks.verify_partial_doubles = true
38
+ end
39
+
40
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
41
+ # have no way to turn it off -- the option exists only for backwards
42
+ # compatibility in RSpec 3). It causes shared context metadata to be
43
+ # inherited by the metadata hash of host groups and examples, rather than
44
+ # triggering implicit auto-inclusion in groups with matching metadata.
45
+ config.shared_context_metadata_behavior = :apply_to_host_groups
46
+
47
+ # The settings below are suggested to provide a good initial experience
48
+ # with RSpec, but feel free to customize to your heart's content.
49
+ =begin
50
+ # This allows you to limit a spec run to individual examples or groups
51
+ # you care about by tagging them with `:focus` metadata. When nothing
52
+ # is tagged with `:focus`, all examples get run. RSpec also provides
53
+ # aliases for `it`, `describe`, and `context` that include `:focus`
54
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
55
+ config.filter_run_when_matching :focus
56
+
57
+ # Allows RSpec to persist some state between runs in order to support
58
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
59
+ # you configure your source control system to ignore this file.
60
+ config.example_status_persistence_file_path = "spec/examples.txt"
61
+
62
+ # Limits the available syntax to the non-monkey patched syntax that is
63
+ # recommended. For more details, see:
64
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
65
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
66
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
67
+ config.disable_monkey_patching!
68
+
69
+ # Many RSpec users commonly either run the entire suite or an individual
70
+ # file, and it's useful to allow more verbose output when running an
71
+ # individual spec file.
72
+ if config.files_to_run.one?
73
+ # Use the documentation formatter for detailed output,
74
+ # unless a formatter has already been configured
75
+ # (e.g. via a command-line flag).
76
+ config.default_formatter = "doc"
77
+ end
78
+
79
+ # Print the 10 slowest examples and example groups at the
80
+ # end of the spec run, to help surface which specs are running
81
+ # particularly slow.
82
+ config.profile_examples = 10
83
+
84
+ # Run specs in random order to surface order dependencies. If you find an
85
+ # order dependency and want to debug it, you can fix the order by providing
86
+ # the seed, which is printed after each run.
87
+ # --seed 1234
88
+ config.order = :random
89
+
90
+ # Seed global randomization in this process using the `--seed` CLI option.
91
+ # Setting this allows you to use `--seed` to deterministically reproduce
92
+ # test failures related to randomization by passing the same `--seed` value
93
+ # as the one that triggered the failure.
94
+ Kernel.srand config.seed
95
+ =end
96
+ end
@@ -0,0 +1,96 @@
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
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+ RSpec.configure do |config|
17
+ # rspec-expectations config goes here. You can use an alternate
18
+ # assertion/expectation library such as wrong or the stdlib/minitest
19
+ # assertions if you prefer.
20
+ config.expect_with :rspec do |expectations|
21
+ # This option will default to `true` in RSpec 4. It makes the `description`
22
+ # and `failure_message` of custom matchers include text for helper methods
23
+ # defined using `chain`, e.g.:
24
+ # be_bigger_than(2).and_smaller_than(4).description
25
+ # # => "be bigger than 2 and smaller than 4"
26
+ # ...rather than:
27
+ # # => "be bigger than 2"
28
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
29
+ end
30
+
31
+ # rspec-mocks config goes here. You can use an alternate test double
32
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
33
+ config.mock_with :rspec do |mocks|
34
+ # Prevents you from mocking or stubbing a method that does not exist on
35
+ # a real object. This is generally recommended, and will default to
36
+ # `true` in RSpec 4.
37
+ mocks.verify_partial_doubles = true
38
+ end
39
+
40
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
41
+ # have no way to turn it off -- the option exists only for backwards
42
+ # compatibility in RSpec 3). It causes shared context metadata to be
43
+ # inherited by the metadata hash of host groups and examples, rather than
44
+ # triggering implicit auto-inclusion in groups with matching metadata.
45
+ config.shared_context_metadata_behavior = :apply_to_host_groups
46
+
47
+ # The settings below are suggested to provide a good initial experience
48
+ # with RSpec, but feel free to customize to your heart's content.
49
+ =begin
50
+ # This allows you to limit a spec run to individual examples or groups
51
+ # you care about by tagging them with `:focus` metadata. When nothing
52
+ # is tagged with `:focus`, all examples get run. RSpec also provides
53
+ # aliases for `it`, `describe`, and `context` that include `:focus`
54
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
55
+ config.filter_run_when_matching :focus
56
+
57
+ # Allows RSpec to persist some state between runs in order to support
58
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
59
+ # you configure your source control system to ignore this file.
60
+ config.example_status_persistence_file_path = "spec/examples.txt"
61
+
62
+ # Limits the available syntax to the non-monkey patched syntax that is
63
+ # recommended. For more details, see:
64
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
65
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
66
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
67
+ config.disable_monkey_patching!
68
+
69
+ # Many RSpec users commonly either run the entire suite or an individual
70
+ # file, and it's useful to allow more verbose output when running an
71
+ # individual spec file.
72
+ if config.files_to_run.one?
73
+ # Use the documentation formatter for detailed output,
74
+ # unless a formatter has already been configured
75
+ # (e.g. via a command-line flag).
76
+ config.default_formatter = "doc"
77
+ end
78
+
79
+ # Print the 10 slowest examples and example groups at the
80
+ # end of the spec run, to help surface which specs are running
81
+ # particularly slow.
82
+ config.profile_examples = 10
83
+
84
+ # Run specs in random order to surface order dependencies. If you find an
85
+ # order dependency and want to debug it, you can fix the order by providing
86
+ # the seed, which is printed after each run.
87
+ # --seed 1234
88
+ config.order = :random
89
+
90
+ # Seed global randomization in this process using the `--seed` CLI option.
91
+ # Setting this allows you to use `--seed` to deterministically reproduce
92
+ # test failures related to randomization by passing the same `--seed` value
93
+ # as the one that triggered the failure.
94
+ Kernel.srand config.seed
95
+ =end
96
+ end
@@ -0,0 +1 @@
1
+ require 'capybara'
@@ -0,0 +1,5 @@
1
+ require 'factory_bot_rails'
2
+
3
+ RSpec.configure do |config|
4
+ config.include FactoryBot::Syntax::Methods
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'rao/shoulda/matchers'
2
+
3
+ RSpec.configure do |config|
4
+ config.include Rao::Shoulda::Matchers, type: :feature
5
+ end
@@ -0,0 +1,8 @@
1
+ require 'shoulda-matchers'
2
+
3
+ Shoulda::Matchers.configure do |config|
4
+ config.integrate do |with|
5
+ with.test_framework :rspec
6
+ with.library :rails
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ require 'factory_bot_rails'
2
+
3
+ FactoryBot = FactoryBot
4
+
5
+ # FactoryBot.definition_file_paths << Cmor::Blorgh::Engine.root.join(*%w(spec factories))
6
+ # FactoryBot.factories.clear
7
+ # FactoryBot.find_definitions
8
+
9
+ RSpec.configure do |config|
10
+ config.include FactoryBot::Syntax::Methods
11
+ end
@@ -0,0 +1,8 @@
1
+ require 'shoulda-matchers'
2
+
3
+ Shoulda::Matchers.configure do |config|
4
+ config.integrate do |with|
5
+ with.test_framework :rspec
6
+ with.library :rails
7
+ end
8
+ end