lcms-engine 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +11 -15
- data/Dockerfile +0 -1
- data/README.md +13 -4
- data/app/assets/javascripts/lcms/engine/admin/application.js +2 -6
- data/app/assets/javascripts/lcms/engine/application.js +2 -2
- data/app/assets/javascripts/lcms/engine/initializers/{google_analytics.js → analytics.js} +0 -0
- data/app/assets/javascripts/lcms/engine/initializers/lessons.js +1 -1
- data/app/assets/stylesheets/lcms/engine/admin.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/application.scss +4 -3
- data/app/assets/stylesheets/lcms/engine/components/_curriculum-cards.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/components/_curriculum-map.scss +4 -4
- data/app/assets/stylesheets/lcms/engine/components/_media-resources.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/components/_panel-dsc.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/components/_resource.scss +6 -6
- data/app/assets/stylesheets/lcms/engine/pages/_home.scss +4 -4
- data/app/assets/stylesheets/lcms/engine/pdf.scss +1 -1
- data/app/assets/stylesheets/lcms/engine/themes/_settings.scss +419 -116
- data/app/assets/stylesheets/lcms/engine/utils/_mixins.scss +2 -2
- data/app/assets/stylesheets/lcms/engine/vendors/foundation_and_overrides-pdf.scss +0 -1
- data/app/assets/stylesheets/lcms/engine/vendors/foundation_and_overrides.scss +13 -2
- data/app/controllers/lcms/engine/admin/admin_controller.rb +0 -2
- data/app/controllers/lcms/engine/admin/association_picker_controller.rb +10 -9
- data/app/controllers/lcms/engine/admin/documents_controller.rb +17 -14
- data/app/controllers/lcms/engine/admin/materials_controller.rb +19 -23
- data/app/controllers/lcms/engine/admin/resource_picker_controller.rb +2 -2
- data/app/controllers/lcms/engine/admin/resources_controller.rb +45 -79
- data/app/controllers/lcms/engine/admin/sketch_compilers_controller.rb +2 -2
- data/app/controllers/lcms/engine/application_controller.rb +0 -15
- data/app/entities/lcms/engine/pagination.rb +14 -5
- data/app/forms/lcms/engine/material_form.rb +0 -1
- data/app/helpers/lcms/engine/application_helper.rb +2 -6
- data/app/helpers/lcms/engine/view_helper.rb +1 -3
- data/app/interactors/lcms/engine/explore_curriculum_interactor.rb +1 -1
- data/app/javascript/components/admin/ImportStatus.jsx +1 -1
- data/app/javascript/components/admin/association-picker/AssociationPickerResults.jsx +1 -1
- data/app/javascript/components/admin/picker/pickerWindowWrapper.jsx +0 -1
- data/app/models/lcms/engine/access_code.rb +1 -1
- data/app/models/lcms/engine/application_record.rb +9 -0
- data/app/models/lcms/engine/author.rb +1 -1
- data/app/models/lcms/engine/copyright_attribution.rb +1 -1
- data/app/models/lcms/engine/curriculum.rb +1 -1
- data/app/models/lcms/engine/document.rb +3 -3
- data/app/models/lcms/engine/document_bundle.rb +2 -2
- data/app/models/lcms/engine/document_part.rb +1 -1
- data/app/models/lcms/engine/download.rb +3 -3
- data/app/models/lcms/engine/download_category.rb +1 -1
- data/app/models/lcms/engine/leadership_post.rb +1 -1
- data/app/models/lcms/engine/material.rb +2 -2
- data/app/models/lcms/engine/material_part.rb +1 -1
- data/app/models/lcms/engine/page.rb +1 -1
- data/app/models/lcms/engine/reading_assignment_author.rb +1 -1
- data/app/models/lcms/engine/reading_assignment_text.rb +1 -1
- data/app/models/lcms/engine/resource.rb +4 -12
- data/app/models/lcms/engine/resource_additional_resource.rb +1 -1
- data/app/models/lcms/engine/resource_download.rb +1 -1
- data/app/models/lcms/engine/resource_reading_assignment.rb +1 -1
- data/app/models/lcms/engine/resource_related_resource.rb +1 -1
- data/app/models/lcms/engine/resource_standard.rb +1 -1
- data/app/models/lcms/engine/search/elastic_search_document.rb +1 -1
- data/app/models/lcms/engine/settings.rb +1 -1
- data/app/models/lcms/engine/social_thumbnail.rb +1 -1
- data/app/models/lcms/engine/staff_member.rb +1 -1
- data/app/models/lcms/engine/standard.rb +1 -1
- data/app/models/lcms/engine/standard_link.rb +1 -1
- data/app/models/lcms/engine/user.rb +3 -3
- data/app/presenters/lcms/engine/content_presenter.rb +1 -1
- data/app/queries/lcms/engine/admin_documents_query.rb +1 -1
- data/app/queries/lcms/engine/admin_materials_query.rb +1 -1
- data/app/serializers/lcms/engine/association_item_serializer.rb +0 -1
- data/app/serializers/lcms/engine/curriculum_resource_serializer.rb +0 -2
- data/app/serializers/lcms/engine/document_material_serializer.rb +0 -1
- data/app/serializers/lcms/engine/material_serializer.rb +0 -1
- data/app/serializers/lcms/engine/previews_material_serializer.rb +0 -1
- data/app/serializers/lcms/engine/resource_details_serializer.rb +0 -2
- data/app/serializers/lcms/engine/resource_instruction_serializer.rb +0 -2
- data/app/serializers/lcms/engine/resource_picker_serializer.rb +0 -2
- data/app/serializers/lcms/engine/resource_serializer.rb +0 -2
- data/app/serializers/lcms/engine/search_document_serializer.rb +0 -2
- data/app/services/lcms/engine/document_build_service.rb +1 -0
- data/app/services/lcms/engine/html_sanitizer.rb +2 -2
- data/app/services/lcms/engine/s3_service.rb +1 -1
- data/app/uploaders/social_thumbnail_uploader.rb +0 -4
- data/app/views/layouts/lcms/engine/admin.html.erb +1 -1
- data/app/views/lcms/engine/admin/access_codes/index.html.erb +10 -8
- data/app/views/lcms/engine/admin/documents/index.html.erb +2 -2
- data/app/views/lcms/engine/admin/materials/index.html.erb +2 -2
- data/app/views/lcms/engine/admin/pages/index.html.erb +3 -3
- data/app/views/lcms/engine/admin/standards/index.html.erb +9 -7
- data/app/views/lcms/engine/admin/users/index.html.erb +16 -14
- data/app/views/lcms/engine/resources/_children_list.html.erb +1 -1
- data/app/views/lcms/engine/shared/_social_sharing_menu.html.erb +4 -4
- data/config/initializers/carrier_wave.rb +0 -1
- data/config/locales/admin/en.yml +0 -2
- data/db/migrate/20200422130652_add_reimported_at_to_documents.rb +7 -0
- data/lcms-engine.gemspec +73 -87
- data/lib/doc_template/document.rb +2 -2
- data/lib/doc_template/tables/activity.rb +2 -1
- data/lib/doc_template/tables/base.rb +0 -4
- data/lib/doc_template/tables/section.rb +2 -1
- data/lib/doc_template/tags/link_tag.rb +1 -1
- data/lib/doc_template/xpath_functions.rb +1 -3
- data/lib/document_exporter/base.rb +1 -2
- data/lib/document_exporter/docx.rb +0 -1
- data/lib/generators/lcms/engine/install/install_generator.rb +1 -4
- data/lib/generators/lcms/engine/install/templates/config/lcms.yml +1 -1
- data/lib/lcms/engine/engine.rb +0 -16
- data/lib/lcms/engine/migration.rb +2 -0
- data/lib/lcms/engine/version.rb +1 -1
- data/lib/lt/lcms/metadata/context.rb +7 -5
- data/spec/controllers/admin/admin_controller_spec.rb +1 -1
- data/spec/controllers/admin/association_picker_controller_spec.rb +2 -2
- data/spec/controllers/admin/curriculums_controller_spec.rb +1 -2
- data/spec/controllers/admin/documents_controller_spec.rb +12 -41
- data/spec/controllers/admin/materials_controller_spec.rb +7 -67
- data/spec/controllers/admin/pages_controller_spec.rb +2 -2
- data/spec/controllers/admin/resource_bulk_edit_controller_spec.rb +3 -3
- data/spec/controllers/admin/sketch_compilers_controller_spec.rb +5 -4
- data/spec/controllers/admin/standards_controller_spec.rb +12 -9
- data/spec/controllers/admin/users_controller_spec.rb +2 -2
- data/spec/controllers/admin/welcome_controller_spec.rb +1 -1
- data/spec/controllers/documents_controller_spec.rb +3 -3
- data/spec/controllers/enhance_instruction_controller_spec.rb +1 -1
- data/spec/controllers/explore_curriculum_controller_spec.rb +2 -2
- data/spec/controllers/find_lessons_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +9 -12
- data/spec/controllers/resources_controller_spec.rb +2 -2
- data/spec/controllers/search_controller_spec.rb +1 -1
- data/spec/dummy/bin/spring +2 -2
- data/spec/dummy/config/application.rb +3 -3
- data/spec/dummy/config/environments/test.rb +2 -5
- data/spec/dummy/config/lcms-admin.yml +3 -3
- data/spec/dummy/config/webpack/development.js +5 -0
- data/spec/dummy/config/webpack/environment.js +3 -0
- data/spec/dummy/config/webpack/production.js +5 -0
- data/spec/dummy/config/webpack/test.js +5 -0
- data/spec/dummy/config/webpacker.yml +96 -0
- data/spec/dummy/db/schema.rb +251 -275
- data/spec/factories/document_bundles.rb +1 -1
- data/spec/factories/standard_links.rb +2 -0
- data/spec/factories/taggings.rb +1 -0
- data/spec/models/document_bundle_spec.rb +0 -6
- data/spec/models/resource_spec.rb +0 -33
- data/spec/rails_helper.rb +0 -1
- data/spec/requests/admin/curriculum_spec.rb +17 -0
- data/spec/services/document_build_service_spec.rb +76 -62
- data/spec/services/html_sanitizer_spec.rb +0 -34
- data/spec/support/capybara.rb +1 -3
- data/spec/support/concerns/searchable.rb +2 -0
- data/spec/support/database_cleaner.rb +5 -16
- data/spec/support/devise.rb +2 -0
- data/yarn.lock +442 -530
- metadata +183 -439
- data/Gemfile.lock +0 -752
- data/config/initializers/active_record.rb +0 -3
- data/spec/controllers/admin/resources_controller_spec.rb +0 -84
- data/spec/fixtures/tables/activity-metadata-3activities.html +0 -1
- data/spec/fixtures/tables/document-metadata-2paragpraphs.html +0 -97
- data/spec/fixtures/tables/document-metadata-2spans.html +0 -96
- data/spec/fixtures/tables/document-metadata.html +0 -96
- data/spec/lib/doc_template/tables/activity_spec.rb +0 -28
- data/spec/lib/doc_template/tables/metadata_spec.rb +0 -40
- data/spec/lib/doc_template/tables/shared_examples/remove_table.rb +0 -11
- data/spec/support/fixture_helper.rb +0 -16
@@ -7,79 +7,17 @@ describe Lcms::Engine::Admin::MaterialsController do
|
|
7
7
|
|
8
8
|
before { sign_in user }
|
9
9
|
|
10
|
-
describe '#create' do
|
11
|
-
let(:material) { create :material }
|
12
|
-
let(:form) { instance_double('Lcms::Engine::MaterialForm', material: material, save: valid) }
|
13
|
-
let(:link) { 'link' }
|
14
|
-
let(:params) { { link: link, source_type: 'gdoc' } }
|
15
|
-
let(:valid) { true }
|
16
|
-
|
17
|
-
before { allow(Lcms::Engine::MaterialForm).to receive(:new).and_return(form) }
|
18
|
-
|
19
|
-
subject { post :create, material_form: params }
|
20
|
-
|
21
|
-
it 'creates MaterialForm object' do
|
22
|
-
expect(Lcms::Engine::MaterialForm).to receive(:new).with(params)
|
23
|
-
subject
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'redirects to material' do
|
27
|
-
subject
|
28
|
-
expect(response).to redirect_to Lcms::Engine::Admin::AdminController.material_path(material)
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when there is an error' do
|
32
|
-
let(:valid) { false }
|
33
|
-
|
34
|
-
it { is_expected.to render_template :new }
|
35
|
-
end
|
36
|
-
|
37
|
-
context 'when a link to Google Documents folder passed in' do
|
38
|
-
let(:credentials) { double }
|
39
|
-
let(:file_ids) { ['file_id'] }
|
40
|
-
let(:folder_id) { 'folder_id' }
|
41
|
-
let(:link) { 'https://drive.google.com/drive/u/x/folders/fkjsdhfjkshfkjsdhf' }
|
42
|
-
|
43
|
-
before do
|
44
|
-
allow(controller).to receive(:google_credentials).and_return(credentials)
|
45
|
-
allow(::Lt::Google::Api::Drive).to \
|
46
|
-
receive(:folder_id_for).with(link).and_return(folder_id)
|
47
|
-
allow(::Lt::Google::Api::Drive).to \
|
48
|
-
receive_message_chain(:new, :list_file_ids_in, :map).and_return(file_ids)
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'calls batch reimport' do
|
52
|
-
expect(Lcms::Engine::DocumentGenerator).to \
|
53
|
-
receive_message_chain(:material_parse_job, :perform_later).and_return(OpenStruct.new(job_id: 0))
|
54
|
-
subject
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'renders import template' do
|
58
|
-
expect(subject).to render_template :import
|
59
|
-
end
|
60
|
-
|
61
|
-
context 'and when there are no documents' do
|
62
|
-
let(:file_ids) { [] }
|
63
|
-
|
64
|
-
it 'shows the message' do
|
65
|
-
subject
|
66
|
-
expect(flash[:alert]).to eq I18n.t('lcms.engine.admin.materials.create.empty_folder')
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
10
|
describe '#destroy' do
|
73
11
|
let!(:material) { create :material }
|
74
12
|
|
75
|
-
subject { delete :destroy, id: material.id }
|
13
|
+
subject { delete :destroy, params: { id: material.id } }
|
76
14
|
|
77
15
|
it { expect { subject }.to change { Lcms::Engine::Material.count }.by(-1) }
|
78
16
|
|
79
17
|
context 'when there was custom filter' do
|
80
18
|
let(:query) { 'filter' }
|
81
19
|
|
82
|
-
subject { delete :destroy, id: material.id, query: query }
|
20
|
+
subject { delete :destroy, params: { id: material.id, query: query } }
|
83
21
|
|
84
22
|
it { is_expected.to redirect_to admin_materials_path(query: query) }
|
85
23
|
end
|
@@ -88,9 +26,10 @@ describe Lcms::Engine::Admin::MaterialsController do
|
|
88
26
|
describe '#index' do
|
89
27
|
subject { get :index }
|
90
28
|
|
91
|
-
it { is_expected.to
|
29
|
+
it { is_expected.to be_successful }
|
92
30
|
|
93
|
-
|
31
|
+
# TODO: Rails upgrade - move to system spec
|
32
|
+
xit { is_expected.to render_template :index }
|
94
33
|
end
|
95
34
|
|
96
35
|
describe '#new' do
|
@@ -101,6 +40,7 @@ describe Lcms::Engine::Admin::MaterialsController do
|
|
101
40
|
subject
|
102
41
|
end
|
103
42
|
|
104
|
-
|
43
|
+
# TODO: Rails upgrade - move to system spec
|
44
|
+
xit { is_expected.to render_template :new }
|
105
45
|
end
|
106
46
|
end
|
@@ -9,11 +9,11 @@ describe Lcms::Engine::Admin::PagesController do
|
|
9
9
|
|
10
10
|
describe '#index' do
|
11
11
|
subject { get :index }
|
12
|
-
it { is_expected.to
|
12
|
+
it { is_expected.to be_successful }
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#new' do
|
16
16
|
subject { get :new }
|
17
|
-
it { is_expected.to
|
17
|
+
it { is_expected.to be_successful }
|
18
18
|
end
|
19
19
|
end
|
@@ -13,15 +13,15 @@ describe Lcms::Engine::Admin::ResourceBulkEditsController do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#new' do
|
16
|
-
subject { get :new, ids: ids }
|
17
|
-
it { is_expected.to
|
16
|
+
subject { get :new, params: { ids: ids } }
|
17
|
+
it { is_expected.to be_successful }
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#create' do
|
21
21
|
it 'updates resources' do
|
22
22
|
grades = resources.flat_map { |r| r.grades.list }
|
23
23
|
expect(grades).to_not include('grade 11')
|
24
|
-
post :create, ids: ids, resource: { grades: ['grade 11'] }
|
24
|
+
post :create, params: { ids: ids, resource: { grades: ['grade 11'] } }
|
25
25
|
expect(response).to redirect_to(:admin_resources)
|
26
26
|
resources.each do |r|
|
27
27
|
expect(r.reload.grades.list).to include('grade 11')
|
@@ -12,12 +12,12 @@ describe Lcms::Engine::Admin::SketchCompilersController do
|
|
12
12
|
let(:url) { 'url' }
|
13
13
|
let(:version) { 'v1' }
|
14
14
|
|
15
|
-
subject { post :compile, params }
|
15
|
+
subject { post :compile, params: params }
|
16
16
|
|
17
17
|
context 'with valid params' do
|
18
18
|
let(:api_response) { double }
|
19
19
|
let(:compiler) { instance_double(Lcms::Engine::SketchCompiler, compile: api_response) }
|
20
|
-
let(:ip) { '
|
20
|
+
let(:ip) { '0.0.0.0' }
|
21
21
|
|
22
22
|
before do
|
23
23
|
allow(Lcms::Engine::SketchCompiler).to receive_message_chain(:new, :compile).and_return(api_response)
|
@@ -62,7 +62,8 @@ describe Lcms::Engine::Admin::SketchCompilersController do
|
|
62
62
|
describe '#new' do
|
63
63
|
subject { get :new }
|
64
64
|
|
65
|
-
|
65
|
+
# TODO: Rails upgrade - move to system spec
|
66
|
+
xcontext 'with google credentials' do
|
66
67
|
let(:credentials) { 'credentials' }
|
67
68
|
|
68
69
|
before { allow(controller).to receive(:google_credentials).and_return(credentials) }
|
@@ -77,7 +78,7 @@ describe Lcms::Engine::Admin::SketchCompilersController do
|
|
77
78
|
context 'when version has been passed in' do
|
78
79
|
let(:version) { 'v2' }
|
79
80
|
|
80
|
-
before { get :new, version: version }
|
81
|
+
before { get :new, params: { version: version } }
|
81
82
|
|
82
83
|
it 'uses passed in version' do
|
83
84
|
expect(assigns(:version)).to eq version
|
@@ -9,24 +9,26 @@ describe Lcms::Engine::Admin::StandardsController do
|
|
9
9
|
before { sign_in user }
|
10
10
|
|
11
11
|
describe '#edit' do
|
12
|
-
subject { get :edit, id: standard.to_param }
|
12
|
+
subject { get :edit, params: { id: standard.to_param } }
|
13
13
|
|
14
|
-
it { is_expected.to
|
14
|
+
it { is_expected.to be_successful }
|
15
15
|
|
16
|
-
|
16
|
+
# TODO: Rails upgrade - move to system spec
|
17
|
+
xit { is_expected.to render_template 'edit' }
|
17
18
|
end
|
18
19
|
|
19
20
|
describe '#index' do
|
20
21
|
subject { get :index }
|
21
22
|
|
22
|
-
it { is_expected.to
|
23
|
+
it { is_expected.to be_successful }
|
23
24
|
|
24
|
-
|
25
|
+
# TODO: Rails upgrade - move to system spec
|
26
|
+
xit { is_expected.to render_template 'index' }
|
25
27
|
|
26
28
|
context 'filters' do
|
27
29
|
let(:scope) { double }
|
28
30
|
|
29
|
-
subject { get :index, query: params }
|
31
|
+
subject { get :index, params: { query: params } }
|
30
32
|
|
31
33
|
context 'name' do
|
32
34
|
let(:name) { 'standard-name' }
|
@@ -42,7 +44,7 @@ describe Lcms::Engine::Admin::StandardsController do
|
|
42
44
|
|
43
45
|
before { allow(Lcms::Engine::Standard).to receive(:order).and_return(scope) }
|
44
46
|
|
45
|
-
subject { get :index, params }
|
47
|
+
subject { get :index, params: params }
|
46
48
|
|
47
49
|
it { expect(scope).to receive(:paginate).with(page: page) }
|
48
50
|
end
|
@@ -55,7 +57,7 @@ describe Lcms::Engine::Admin::StandardsController do
|
|
55
57
|
let(:description) { 's-description' }
|
56
58
|
let(:params) { { description: description } }
|
57
59
|
|
58
|
-
subject { post :update, id: standard.to_param, standard: params }
|
60
|
+
subject { post :update, params: { id: standard.to_param, standard: params } }
|
59
61
|
|
60
62
|
context 'with valid params' do
|
61
63
|
it { is_expected.to redirect_to admin_standards_path }
|
@@ -69,7 +71,8 @@ describe Lcms::Engine::Admin::StandardsController do
|
|
69
71
|
context 'with invalid params' do
|
70
72
|
before { allow_any_instance_of(Lcms::Engine::Standard).to receive(:update).and_return(false) }
|
71
73
|
|
72
|
-
|
74
|
+
# TODO: Rails upgrade - move to system spec
|
75
|
+
xit 'renders edit' do
|
73
76
|
expect(subject).to render_template :edit
|
74
77
|
end
|
75
78
|
end
|
@@ -9,11 +9,11 @@ describe Lcms::Engine::Admin::UsersController do
|
|
9
9
|
|
10
10
|
describe '#index' do
|
11
11
|
subject { get :index }
|
12
|
-
it { is_expected.to
|
12
|
+
it { is_expected.to be_successful }
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#new' do
|
16
16
|
subject { get :new }
|
17
|
-
it { is_expected.to
|
17
|
+
it { is_expected.to be_successful }
|
18
18
|
end
|
19
19
|
end
|
@@ -22,7 +22,7 @@ describe Lcms::Engine::DocumentsController do
|
|
22
22
|
# allow(Lcms::Engine::DocumentExporter::GDoc::Base).to receive_message_chain(:new, :export).and_return(exporter)
|
23
23
|
# end
|
24
24
|
|
25
|
-
subject { get :export_gdoc, id: document.id }
|
25
|
+
subject { get :export_gdoc, params: { id: document.id } }
|
26
26
|
|
27
27
|
it 'renders document content into a string' do
|
28
28
|
expect(controller).to receive(:render).with(json: { url: nil }, status: :ok)
|
@@ -60,7 +60,7 @@ describe Lcms::Engine::DocumentsController do
|
|
60
60
|
allow(Lcms::Engine::DocumentGeneratePdfJob).to receive_message_chain(:perform_later, :job_id).and_return(job_id)
|
61
61
|
end
|
62
62
|
|
63
|
-
subject { post :export, id: document.id, type: type, excludes: excludes, context: 'pdf' }
|
63
|
+
subject { post :export, params: { id: document.id, type: type, excludes: excludes, context: 'pdf' } }
|
64
64
|
|
65
65
|
it 'calls S3Service' do
|
66
66
|
expect(Lcms::Engine::S3Service).to receive(:url_for)
|
@@ -100,7 +100,7 @@ describe Lcms::Engine::DocumentsController do
|
|
100
100
|
|
101
101
|
before { allow(Lcms::Engine::DocumentGeneratePdfJob).to receive(:find) }
|
102
102
|
|
103
|
-
subject { get :export_status, context: 'pdf', id: document.id, jid: job_id }
|
103
|
+
subject { get :export_status, params: { context: 'pdf', id: document.id, jid: job_id } }
|
104
104
|
|
105
105
|
it 'looks up job queue for the job' do
|
106
106
|
expect(Lcms::Engine::DocumentGeneratePdfJob).to receive(:find).with(job_id)
|
@@ -8,7 +8,7 @@ xdescribe Lcms::Engine::EnhanceInstructionController do
|
|
8
8
|
describe '#index' do
|
9
9
|
before { get :index }
|
10
10
|
|
11
|
-
it { expect(response).to
|
11
|
+
it { expect(response).to be_successful }
|
12
12
|
it { expect(response).to render_template(:index) }
|
13
13
|
it { expect(assigns(:props)).to be_present }
|
14
14
|
end
|
@@ -13,7 +13,7 @@ xdescribe Lcms::Engine::ExploreCurriculumController do
|
|
13
13
|
context 'default' do
|
14
14
|
before { get :index }
|
15
15
|
|
16
|
-
it { expect(response).to
|
16
|
+
it { expect(response).to be_successful }
|
17
17
|
it { expect(response).to render_template(:index) }
|
18
18
|
it { expect(assigns(:props)).to be_present }
|
19
19
|
end
|
@@ -21,7 +21,7 @@ xdescribe Lcms::Engine::ExploreCurriculumController do
|
|
21
21
|
context 'expanded' do
|
22
22
|
before { get :index, p: '/ela/grade-2/module-1', e: '1' }
|
23
23
|
|
24
|
-
it { expect(response).to
|
24
|
+
it { expect(response).to be_successful }
|
25
25
|
it { expect(response).to render_template(:index) }
|
26
26
|
it { expect(assigns(:props)).to be_present }
|
27
27
|
end
|
@@ -11,7 +11,7 @@ xdescribe Lcms::Engine::FindLessonsController do
|
|
11
11
|
let!(:serialized) { ResourceSerializer.new(resource).as_json }
|
12
12
|
before { get :index }
|
13
13
|
|
14
|
-
it { expect(response).to
|
14
|
+
it { expect(response).to be_successful }
|
15
15
|
it { expect(response).to render_template(:index) }
|
16
16
|
it { expect(assigns(:props)).to be_present }
|
17
17
|
it { expect(assigns(:props)[:results]).to include(serialized) }
|
@@ -2,34 +2,31 @@
|
|
2
2
|
|
3
3
|
require 'rails_helper'
|
4
4
|
require 'rake'
|
5
|
-
require 'seedbank'
|
6
5
|
|
7
6
|
describe Lcms::Engine::PagesController do
|
8
7
|
before(:all) do
|
9
|
-
|
10
|
-
Rake::Task.define_task(:environment)
|
11
|
-
Rake::Task['db:seed:pages'].invoke
|
8
|
+
load File.expand_path '../../db/seeds/pages.seeds.rb', __dir__
|
12
9
|
end
|
13
10
|
|
14
11
|
before { sign_in create :user }
|
15
12
|
|
16
13
|
describe 'about page' do
|
17
|
-
before { get :show_slug, slug: 'about' }
|
18
|
-
it { expect(response).to
|
14
|
+
before { get :show_slug, params: { slug: 'about' } }
|
15
|
+
it { expect(response).to be_successful }
|
19
16
|
end
|
20
17
|
|
21
18
|
describe 'about_people page' do
|
22
|
-
before { get :show_slug, slug: 'about_people' }
|
23
|
-
it { expect(response).to
|
19
|
+
before { get :show_slug, params: { slug: 'about_people' } }
|
20
|
+
it { expect(response).to be_successful }
|
24
21
|
end
|
25
22
|
|
26
23
|
describe 'tos page' do
|
27
|
-
before { get :show_slug, slug: 'tos' }
|
28
|
-
it { expect(response).to
|
24
|
+
before { get :show_slug, params: { slug: 'tos' } }
|
25
|
+
it { expect(response).to be_successful }
|
29
26
|
end
|
30
27
|
|
31
28
|
describe 'privacy page' do
|
32
|
-
before { get :show_slug, slug: 'privacy' }
|
33
|
-
it { expect(response).to
|
29
|
+
before { get :show_slug, params: { slug: 'privacy' } }
|
30
|
+
it { expect(response).to be_successful }
|
34
31
|
end
|
35
32
|
end
|
@@ -15,7 +15,7 @@ xdescribe Lcms::Engine::ResourcesController do
|
|
15
15
|
|
16
16
|
before { allow(URI).to receive_message_chain(:parse, :open, :read).and_return(data) }
|
17
17
|
|
18
|
-
subject { get :pdf_proxy, url: url }
|
18
|
+
subject { get :pdf_proxy, params: { url: url } }
|
19
19
|
|
20
20
|
it 'proxies the request' do
|
21
21
|
expect(controller).to receive(:send_data).with(data, params) do
|
@@ -41,7 +41,7 @@ xdescribe Lcms::Engine::ResourcesController do
|
|
41
41
|
context 'with slug' do
|
42
42
|
before { get :show, slug: resource.slug }
|
43
43
|
|
44
|
-
it { expect(response).to
|
44
|
+
it { expect(response).to be_successful }
|
45
45
|
it { expect(assigns(:resource)).to be_present }
|
46
46
|
it { expect(assigns(:props)).to_not be_nil }
|
47
47
|
end
|
data/spec/dummy/bin/spring
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# This file loads
|
3
|
+
# This file loads Spring without using Bundler, in order to be fast.
|
4
4
|
# It gets overwritten when you run the `spring binstub` command.
|
5
5
|
|
6
6
|
unless defined?(Spring)
|
@@ -8,7 +8,7 @@ unless defined?(Spring)
|
|
8
8
|
require 'bundler'
|
9
9
|
|
10
10
|
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
-
spring = lockfile.specs.detect { |spec| spec.name ==
|
11
|
+
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
|
12
12
|
if spring
|
13
13
|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
14
14
|
gem 'spring', spring.version
|
@@ -16,14 +16,14 @@ require 'lcms/engine'
|
|
16
16
|
|
17
17
|
module Dummy
|
18
18
|
class Application < Rails::Application
|
19
|
+
# Initialize configuration defaults for originally generated Rails version.
|
20
|
+
config.load_defaults 5.2
|
21
|
+
|
19
22
|
# Settings in config/environments/* take precedence over those specified here.
|
20
23
|
# Application configuration can go into files in config/initializers
|
21
24
|
# -- all .rb files in that directory are automatically loaded after loading
|
22
25
|
# the framework and any gems in your application.
|
23
26
|
|
24
|
-
# Do not swallow errors in after_commit/after_rollback callbacks.
|
25
|
-
config.active_record.raise_in_transactional_callbacks = true
|
26
|
-
|
27
27
|
config.autoload_paths += [
|
28
28
|
Rails.root.join('lib')
|
29
29
|
]
|
@@ -14,8 +14,8 @@ Rails.application.configure do
|
|
14
14
|
# preloads Rails for running tests, you may have to set it to true.
|
15
15
|
config.eager_load = false
|
16
16
|
|
17
|
-
config.
|
18
|
-
config.
|
17
|
+
config.public_file_server.enabled = true
|
18
|
+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
19
19
|
|
20
20
|
# Show full error reports and disable caching.
|
21
21
|
config.consider_all_requests_local = true
|
@@ -33,9 +33,6 @@ Rails.application.configure do
|
|
33
33
|
config.action_mailer.delivery_method = :test
|
34
34
|
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
35
35
|
|
36
|
-
# Randomize the order test cases are executed.
|
37
|
-
config.active_support.test_order = :random
|
38
|
-
|
39
36
|
# Print deprecation notices to the stderr.
|
40
37
|
config.active_support.deprecation = :stderr
|
41
38
|
|