cmor_files 0.0.51.pre → 0.0.52.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +6 -138
- data/spec/config/locales/de.yml +0 -3
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/javascripts/cable.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
- data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
- data/spec/dummy/app/controllers/application_controller.rb +0 -2
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/jobs/application_job.rb +0 -2
- data/spec/dummy/app/mailers/application_mailer.rb +0 -4
- data/spec/dummy/app/models/application_record.rb +0 -3
- data/spec/dummy/app/views/layouts/application.html.erb +0 -15
- data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -36
- data/spec/dummy/bin/update +0 -31
- data/spec/dummy/bin/yarn +0 -11
- data/spec/dummy/config.ru +0 -5
- data/spec/dummy/config/application.rb +0 -30
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/cable.yml +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -61
- data/spec/dummy/config/environments/production.rb +0 -94
- data/spec/dummy/config/environments/test.rb +0 -46
- data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/dummy/config/initializers/assets.rb +0 -14
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cmor_files.rb +0 -7
- data/spec/dummy/config/initializers/content_security_policy.rb +0 -25
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/i18n.rb +0 -2
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -33
- data/spec/dummy/config/puma.rb +0 -34
- data/spec/dummy/config/routes.rb +0 -6
- data/spec/dummy/config/spring.rb +0 -6
- data/spec/dummy/config/storage.yml +0 -34
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20200119054027_create_active_storage_tables.active_storage.rb +0 -27
- data/spec/dummy/db/migrate/20200119054052_create_cmor_files_folders.cmor_files.rb +0 -12
- data/spec/dummy/db/migrate/20200119054053_create_cmor_files_file_details.cmor_files.rb +0 -14
- data/spec/dummy/db/schema.rb +0 -54
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -122
- data/spec/dummy/log/test.log +0 -143
- data/spec/dummy/package.json +0 -5
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/development_secret.txt +0 -1
- data/spec/dummy/tmp/storage/5Z/Lz/5ZLz1RnTjSv6JxA2kxa6Wfdj +0 -0
- data/spec/dummy/tmp/storage/Qc/Te/QcTeyM8PiNUmVbGyawobiMy1 +0 -0
- data/spec/dummy~/Rakefile +0 -6
- data/spec/dummy~/app/assets/config/manifest.js +0 -4
- data/spec/dummy~/app/assets/javascripts/application.js +0 -14
- data/spec/dummy~/app/assets/javascripts/cable.js +0 -13
- data/spec/dummy~/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy~/app/channels/application_cable/channel.rb +0 -4
- data/spec/dummy~/app/channels/application_cable/connection.rb +0 -4
- data/spec/dummy~/app/controllers/application_controller.rb +0 -2
- data/spec/dummy~/app/helpers/application_helper.rb +0 -2
- data/spec/dummy~/app/jobs/application_job.rb +0 -2
- data/spec/dummy~/app/mailers/application_mailer.rb +0 -4
- data/spec/dummy~/app/models/application_record.rb +0 -3
- data/spec/dummy~/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy~/app/views/layouts/mailer.html.erb +0 -13
- data/spec/dummy~/app/views/layouts/mailer.text.erb +0 -1
- data/spec/dummy~/bin/bundle +0 -3
- data/spec/dummy~/bin/rails +0 -4
- data/spec/dummy~/bin/rake +0 -4
- data/spec/dummy~/bin/setup +0 -36
- data/spec/dummy~/bin/update +0 -31
- data/spec/dummy~/bin/yarn +0 -11
- data/spec/dummy~/config.ru +0 -5
- data/spec/dummy~/config/application.rb +0 -30
- data/spec/dummy~/config/boot.rb +0 -5
- data/spec/dummy~/config/cable.yml +0 -10
- data/spec/dummy~/config/database.yml +0 -25
- data/spec/dummy~/config/environment.rb +0 -5
- data/spec/dummy~/config/environments/development.rb +0 -61
- data/spec/dummy~/config/environments/production.rb +0 -94
- data/spec/dummy~/config/environments/test.rb +0 -46
- data/spec/dummy~/config/initializers/application_controller_renderer.rb +0 -8
- data/spec/dummy~/config/initializers/assets.rb +0 -14
- data/spec/dummy~/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy~/config/initializers/cmor/files.rb +0 -7
- data/spec/dummy~/config/initializers/content_security_policy.rb +0 -22
- data/spec/dummy~/config/initializers/cookies_serializer.rb +0 -5
- data/spec/dummy~/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy~/config/initializers/inflections.rb +0 -16
- data/spec/dummy~/config/initializers/mime_types.rb +0 -4
- data/spec/dummy~/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy~/config/locales/en.yml +0 -33
- data/spec/dummy~/config/puma.rb +0 -34
- data/spec/dummy~/config/routes.rb +0 -3
- data/spec/dummy~/config/spring.rb +0 -6
- data/spec/dummy~/config/storage.yml +0 -35
- data/spec/dummy~/db/development.sqlite3 +0 -0
- data/spec/dummy~/db/schema.rb +0 -41
- data/spec/dummy~/db/test.sqlite3 +0 -0
- data/spec/dummy~/package.json +0 -5
- data/spec/dummy~/public/404.html +0 -67
- data/spec/dummy~/public/422.html +0 -67
- data/spec/dummy~/public/500.html +0 -66
- data/spec/dummy~/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy~/public/apple-touch-icon.png +0 -0
- data/spec/dummy~/public/favicon.ico +0 -0
- data/spec/factories/cmor_files_file_details.rb +0 -17
- data/spec/factories/cmor_files_folders.rb +0 -6
- data/spec/models/cmor/files/file_detail_spec.rb +0 -7
- data/spec/models/cmor/files/folder_spec.rb +0 -12
- data/spec/models/generic_spec.rb +0 -50
- data/spec/models/i18n_spec.rb +0 -41
- data/spec/rails_helper.rb +0 -62
- data/spec/spec_helper.rb +0 -96
- data/spec/support/capybara.rb +0 -1
- data/spec/support/factory_bot.rb +0 -5
- data/spec/support/rao-shoulda_matchers.rb +0 -5
- data/spec/support/shoulda_matchers.rb +0 -8
Binary file
|
data/spec/dummy~/db/schema.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 2018_03_01_100352) do
|
14
|
-
|
15
|
-
create_table "active_storage_attachments", force: :cascade do |t|
|
16
|
-
t.string "name", null: false
|
17
|
-
t.string "record_type", null: false
|
18
|
-
t.integer "record_id", null: false
|
19
|
-
t.integer "blob_id", null: false
|
20
|
-
t.datetime "created_at", null: false
|
21
|
-
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
22
|
-
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
23
|
-
end
|
24
|
-
|
25
|
-
create_table "active_storage_blobs", force: :cascade do |t|
|
26
|
-
t.string "key", null: false
|
27
|
-
t.string "filename", null: false
|
28
|
-
t.string "content_type"
|
29
|
-
t.text "metadata"
|
30
|
-
t.bigint "byte_size", null: false
|
31
|
-
t.string "checksum", null: false
|
32
|
-
t.datetime "created_at", null: false
|
33
|
-
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
34
|
-
end
|
35
|
-
|
36
|
-
create_table "cmor_files_collections", force: :cascade do |t|
|
37
|
-
t.datetime "created_at", null: false
|
38
|
-
t.datetime "updated_at", null: false
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
data/spec/dummy~/db/test.sqlite3
DELETED
Binary file
|
data/spec/dummy~/package.json
DELETED
data/spec/dummy~/public/404.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/404.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
data/spec/dummy~/public/422.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/422.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The change you wanted was rejected.</h1>
|
62
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
data/spec/dummy~/public/500.html
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/500.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>We're sorry, but something went wrong.</h1>
|
62
|
-
</div>
|
63
|
-
<p>If you are the application owner check the logs for more information.</p>
|
64
|
-
</div>
|
65
|
-
</body>
|
66
|
-
</html>
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,17 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :cmor_files_file_detail, class: 'Cmor::Files::FileDetail' do
|
3
|
-
association :folder, factory: :cmor_files_folder
|
4
|
-
after(:build) { |resource|
|
5
|
-
assets = resource.folder.assets.attach(
|
6
|
-
io: File.open(File.join(Cmor::Files::Engine.root.join(*%w( spec files cmor files file_details example.png)))),
|
7
|
-
filename: 'example.png',
|
8
|
-
content_type: 'image/png'
|
9
|
-
)
|
10
|
-
if Rails.version < "6.0.0"
|
11
|
-
resource.asset = assets.first
|
12
|
-
else
|
13
|
-
resource.asset = resource.folder.assets.first
|
14
|
-
end
|
15
|
-
}
|
16
|
-
end
|
17
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
module Cmor::Files
|
4
|
-
RSpec.describe Folder, type: :model do
|
5
|
-
it { expect(subject).to respond_to(:assets=) }
|
6
|
-
it { expect(subject).to respond_to(:assets) }
|
7
|
-
it { expect(subject).to respond_to(:assets_count) }
|
8
|
-
|
9
|
-
it { expect(subject).to validate_presence_of(:name) }
|
10
|
-
it { expect(subject).to validate_uniqueness_of(:name).scoped_to([:locale]) }
|
11
|
-
end
|
12
|
-
end
|
data/spec/models/generic_spec.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'ActiveRecord::Base models', type: :model do
|
4
|
-
DEFAULT_SPECS_TO_RUN = [
|
5
|
-
:is_an_active_record,
|
6
|
-
:is_instanciable,
|
7
|
-
:valid_with_correct_attributes,
|
8
|
-
:not_valid_with_empty_attributes,
|
9
|
-
:saves_with_valid_attributes
|
10
|
-
]
|
11
|
-
|
12
|
-
{
|
13
|
-
Cmor::Files::Folder => {},
|
14
|
-
Cmor::Files::FileDetail => {},
|
15
|
-
}.each do |model, options|
|
16
|
-
options.reverse_merge!(specs_to_run: DEFAULT_SPECS_TO_RUN, specs_to_skip: [])
|
17
|
-
specs_to_run = options.delete(:specs_to_run)
|
18
|
-
specs_to_skip = options.delete(:specs_to_skip)
|
19
|
-
specs = specs_to_run - specs_to_skip
|
20
|
-
|
21
|
-
describe model do
|
22
|
-
it 'is an ActiveRecord::Base' do
|
23
|
-
expect(ActiveRecord::Base.descendants).to include(model)
|
24
|
-
end if specs.include?(:is_an_active_record)
|
25
|
-
|
26
|
-
it 'is instanciable' do
|
27
|
-
instance = model.new
|
28
|
-
expect(instance).to be_a(model)
|
29
|
-
end if specs.include?(:is_instanciable)
|
30
|
-
|
31
|
-
it 'is valid with correct attribute values' do
|
32
|
-
instance = build(model.to_s.tableize.singularize.underscore.tr('/', '_'))
|
33
|
-
|
34
|
-
instance.valid?
|
35
|
-
expect(instance.errors.full_messages).to eq([])
|
36
|
-
end if specs.include?(:valid_with_correct_attributes)
|
37
|
-
|
38
|
-
it 'is not valid with empty attributes' do
|
39
|
-
instance = model.new
|
40
|
-
expect(instance).not_to be_valid
|
41
|
-
end if specs.include?(:not_valid_with_empty_attributes)
|
42
|
-
|
43
|
-
it 'saves with valid attributes' do
|
44
|
-
instance = build(model.to_s.tableize.singularize.underscore.tr('/', '_'))
|
45
|
-
expect(instance.save).to be_truthy
|
46
|
-
expect(instance).to be_persisted
|
47
|
-
end if specs.include?(:saves_with_valid_attributes)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
data/spec/models/i18n_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'Translations', type: :model do
|
4
|
-
{
|
5
|
-
Cmor::Files::Folder => {},
|
6
|
-
Cmor::Files::FileDetail => {},
|
7
|
-
}.each do |model, options|
|
8
|
-
I18n.available_locales.each do |locale|
|
9
|
-
I18n.locale = locale
|
10
|
-
|
11
|
-
describe "for locale #{locale}:" do
|
12
|
-
describe "#{model} translations" do
|
13
|
-
it 'include one' do
|
14
|
-
I18n.locale = locale
|
15
|
-
i18n_key = ['activerecord', 'models', model.name.underscore].join('.')
|
16
|
-
i18n_options = {}
|
17
|
-
expect(I18n.translate!(i18n_key, options)[:one]).to be_a(String)
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'include other' do
|
21
|
-
I18n.locale = locale
|
22
|
-
i18n_key = ['activerecord', 'models', model.name.underscore].join('.')
|
23
|
-
i18n_options = {}
|
24
|
-
expect(I18n.translate!(i18n_key, options)[:other]).to be_a(String)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe 'for attributes' do
|
28
|
-
|
29
|
-
model.column_names.each do |column_name|
|
30
|
-
it "include #{column_name}" do
|
31
|
-
I18n.locale = locale
|
32
|
-
i18n_key = ['activerecord', 'attributes', model.name.underscore, column_name].join('.')
|
33
|
-
expect(I18n.translate!(i18n_key)).to be_a(String)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
data/spec/rails_helper.rb
DELETED
@@ -1,62 +0,0 @@
|
|
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::Files::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
|