spina-admin-conferences-blog 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +42 -0
- data/Rakefile +34 -0
- data/app/assets/config/spina_admin_conferences_blog_manifest.js +0 -0
- data/app/controllers/spina/admin/conferences/blog/categories_controller.rb +80 -0
- data/app/controllers/spina/admin/conferences/blog/posts_controller.rb +103 -0
- data/app/decorators/spina/admin/conferences/blog/post_decorator.rb +26 -0
- data/app/helpers/spina/admin/conferences/blog/posts_helper.rb +18 -0
- data/app/models/spina/admin/conferences/blog/application_record.rb +12 -0
- data/app/models/spina/admin/conferences/blog/category.rb +23 -0
- data/app/models/spina/admin/conferences/blog/post.rb +52 -0
- data/app/models/spina/admin/conferences/blog.rb +10 -0
- data/app/views/layouts/spina/admin/conferences/blog/blog.html.haml +29 -0
- data/app/views/layouts/spina/admin/conferences/blog/categories.html.haml +10 -0
- data/app/views/spina/admin/conferences/blog/categories/_category.html.haml +8 -0
- data/app/views/spina/admin/conferences/blog/categories/_form.html.haml +42 -0
- data/app/views/spina/admin/conferences/blog/categories/edit.html.haml +3 -0
- data/app/views/spina/admin/conferences/blog/categories/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/blog/categories/new.html.haml +2 -0
- data/app/views/spina/admin/conferences/blog/posts/_form.html.haml +43 -0
- data/app/views/spina/admin/conferences/blog/posts/_form_post_configuration.html.haml +50 -0
- data/app/views/spina/admin/conferences/blog/posts/_form_post_content.html.haml +46 -0
- data/app/views/spina/admin/conferences/blog/posts/_form_post_seo.html.haml +14 -0
- data/app/views/spina/admin/conferences/blog/posts/_post.html.haml +19 -0
- data/app/views/spina/admin/conferences/blog/posts/edit.html.haml +3 -0
- data/app/views/spina/admin/conferences/blog/posts/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/blog/posts/new.html.haml +2 -0
- data/app/views/spina/admin/hooks/conferences/blog/_primary_navigation.html.haml +10 -0
- data/config/initializers/friendly_id.rb +94 -0
- data/config/locales/en.yml +41 -0
- data/config/locales/nl.yml +42 -0
- data/config/locales/pt-BR.yml +41 -0
- data/config/routes.rb +32 -0
- data/db/migrate/1_create_spina_blog_posts.rb +18 -0
- data/db/migrate/2_create_spina_blog_friendly_id_slugs.rb +19 -0
- data/db/migrate/3_create_spina_blog_categories.rb +12 -0
- data/db/migrate/4_add_category_id_to_spina_blog_posts.rb +7 -0
- data/db/migrate/5_add_featured_to_spina_blog_posts.rb +9 -0
- data/db/migrate/6_add_seo_fields.rb +11 -0
- data/lib/generators/spina_admin_conferences_blog/install_generator.rb +24 -0
- data/lib/spina/admin/conferences/blog/configuration.rb +17 -0
- data/lib/spina/admin/conferences/blog/engine.rb +24 -0
- data/lib/spina/admin/conferences/blog/version.rb +8 -0
- data/lib/spina/admin/conferences/blog.rb +18 -0
- data/lib/spina/admin/conferences.rb +6 -0
- data/lib/spina/admin.rb +5 -0
- data/lib/tasks/spina/admin/conferences/blog_tasks.rake +14 -0
- data/spec/controllers/spina/admin/conferences/blog/categories_controller_spec.rb +99 -0
- data/spec/controllers/spina/admin/conferences/blog/posts_controller_spec.rb +152 -0
- data/spec/dummy/Rakefile +8 -0
- data/spec/dummy/app/assets/config/manifest.js +4 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/default/application.css.sass +0 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/jobs/application_job.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +6 -0
- data/spec/dummy/app/models/application_record.rb +6 -0
- data/spec/dummy/app/views/default/pages/homepage.html.haml +2 -0
- data/spec/dummy/app/views/default/pages/show.html.haml +3 -0
- data/spec/dummy/app/views/default/shared/_navigation.html.haml +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/default/application.html.haml +11 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/config/application.rb +16 -0
- data/spec/dummy/config/boot.rb +7 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/database.yml +17 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +56 -0
- data/spec/dummy/config/environments/production.rb +88 -0
- data/spec/dummy/config/environments/test.rb +44 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +13 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/inflections.rb +18 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/mobility.rb +16 -0
- data/spec/dummy/config/initializers/new_framework_defaults.rb +25 -0
- data/spec/dummy/config/initializers/session_store.rb +5 -0
- data/spec/dummy/config/initializers/spina.rb +22 -0
- data/spec/dummy/config/initializers/themes/default.rb +32 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/puma.rb +49 -0
- data/spec/dummy/config/routes.rb +6 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/db/migrate/20190513103729_create_spina_tables.spina.rb +132 -0
- data/spec/dummy/db/migrate/20190513103730_create_spina_translation_tables.spina.rb +46 -0
- data/spec/dummy/db/migrate/20190513103731_create_spina_navigations.spina.rb +24 -0
- data/spec/dummy/db/migrate/20190513103732_add_password_reset_token_to_spina_users.spina.rb +9 -0
- data/spec/dummy/db/migrate/20190513103733_remove_translated_columns.spina.rb +14 -0
- data/spec/dummy/db/migrate/20190513103734_create_spina_options.spina.rb +11 -0
- data/spec/dummy/db/migrate/20190513103735_create_spina_settings.spina.rb +14 -0
- data/spec/dummy/db/migrate/20190513103736_create_spina_media_folders.spina.rb +11 -0
- data/spec/dummy/db/migrate/20190513103737_create_spina_images.spina.rb +13 -0
- data/spec/dummy/db/migrate/20190513103738_create_spina_image_collections.spina.rb +17 -0
- data/spec/dummy/db/migrate/20190513103739_create_spina_resources.spina.rb +18 -0
- data/spec/dummy/db/schema.rb +288 -0
- data/spec/dummy/db/seeds.rb +4 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- 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/spina/admin/conferences/blog/categories.rb +11 -0
- data/spec/factories/spina/admin/conferences/blog/posts.rb +16 -0
- data/spec/models/spina/admin/conferences/blog/category_spec.rb +21 -0
- data/spec/models/spina/admin/conferences/blog/post_spec.rb +39 -0
- data/spec/rails_helper.rb +68 -0
- data/spec/spec_helper.rb +97 -0
- data/spec/support/capybara.rb +25 -0
- data/spec/support/controller_helpers.rb +25 -0
- data/spec/support/controller_routes.rb +13 -0
- data/spec/support/factory_bot.rb +5 -0
- data/spec/support/rails_controller_testing.rb +13 -0
- data/spec/support/system_tests.rb +11 -0
- data/spec/system/spina/admin/conferences/blog/posts_spec.rb +34 -0
- data/spec/system/support/image.png +0 -0
- metadata +508 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
RSpec.describe Spina::Admin::Conferences::Blog::CategoriesController, type: :controller do
|
6
|
+
let(:categories) { create_list(:spina_blog_category, 3) }
|
7
|
+
let(:category) { create(:spina_blog_category) }
|
8
|
+
let(:category_attributes) { attributes_for(:spina_blog_category) }
|
9
|
+
|
10
|
+
routes { Spina::Engine.routes }
|
11
|
+
|
12
|
+
context 'when signed in as an admin' do
|
13
|
+
before { sign_in }
|
14
|
+
|
15
|
+
describe 'GET #index' do
|
16
|
+
subject { get :index }
|
17
|
+
|
18
|
+
it { is_expected.to be_successful }
|
19
|
+
it { is_expected.to render_template :index }
|
20
|
+
it {
|
21
|
+
subject
|
22
|
+
expect(assigns(:categories)).to match_array categories
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'GET #new' do
|
27
|
+
subject { get :new }
|
28
|
+
|
29
|
+
it { is_expected.to be_successful }
|
30
|
+
it { is_expected.to render_template :new }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'POST #create' do
|
34
|
+
subject { post :create, params: { category: category_attributes } }
|
35
|
+
|
36
|
+
it { is_expected.to have_http_status :redirect }
|
37
|
+
it {
|
38
|
+
subject
|
39
|
+
expect(flash[:notice]).to eq 'Category saved'
|
40
|
+
}
|
41
|
+
it { expect { subject }.to change(Spina::Admin::Conferences::Blog::Category, :count).by(1) }
|
42
|
+
|
43
|
+
context 'with invalid attributes' do
|
44
|
+
subject { post :create, params: { category: { name: '' } } }
|
45
|
+
|
46
|
+
it { is_expected.to_not have_http_status :redirect }
|
47
|
+
it { expect { subject }.to_not change(Spina::Admin::Conferences::Blog::Category, :count) }
|
48
|
+
it { is_expected.to render_template :new }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe 'GET #edit' do
|
53
|
+
subject { get :edit, params: { id: category.id } }
|
54
|
+
|
55
|
+
it { is_expected.to be_successful }
|
56
|
+
it { is_expected.to render_template :edit }
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'PATCH #update' do
|
60
|
+
subject do
|
61
|
+
patch :update,
|
62
|
+
params: { id: category.id, category: category_attributes }
|
63
|
+
end
|
64
|
+
|
65
|
+
it { is_expected.to have_http_status :redirect }
|
66
|
+
it {
|
67
|
+
subject
|
68
|
+
expect(flash[:notice]).to eq 'Category saved'
|
69
|
+
}
|
70
|
+
it { expect { subject }.to(change { category.reload.name }) }
|
71
|
+
|
72
|
+
context 'with invalid attributes' do
|
73
|
+
subject do
|
74
|
+
patch :update, params: { id: category.id, category: { name: '' } }
|
75
|
+
end
|
76
|
+
|
77
|
+
it { is_expected.to_not have_http_status :redirect }
|
78
|
+
it { is_expected.to render_template :edit }
|
79
|
+
it { expect { subject }.not_to(change { category.reload.name }) }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe 'DELETE #destroy' do
|
84
|
+
let!(:category) { create(:spina_blog_category) }
|
85
|
+
|
86
|
+
subject { delete :destroy, params: { id: category.id } }
|
87
|
+
|
88
|
+
it { expect { subject }.to change(Spina::Admin::Conferences::Blog::Category, :count).by(-1) }
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
context 'signed out' do
|
93
|
+
describe 'GET #index' do
|
94
|
+
subject { get :index }
|
95
|
+
it { is_expected.to have_http_status :redirect }
|
96
|
+
it { is_expected.to_not render_template :index }
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
RSpec.describe Spina::Admin::Conferences::Blog::PostsController, type: :controller do
|
6
|
+
let(:posts) { create_list(:spina_blog_post, 3) }
|
7
|
+
let(:blog_post) { create(:spina_blog_post) }
|
8
|
+
let(:draft_posts) { create_list(:spina_blog_post, 3, draft: true) }
|
9
|
+
let(:live_posts) { create_list(:spina_blog_post, 3, draft: false) }
|
10
|
+
let(:post_attributes) { attributes_for(:spina_blog_post) }
|
11
|
+
|
12
|
+
routes { Spina::Engine.routes }
|
13
|
+
|
14
|
+
context 'signed in as an admin' do
|
15
|
+
before { sign_in }
|
16
|
+
|
17
|
+
describe 'GET #index' do
|
18
|
+
subject { get :index }
|
19
|
+
|
20
|
+
it { is_expected.to be_successful }
|
21
|
+
it { is_expected.to render_template :index }
|
22
|
+
it {
|
23
|
+
subject
|
24
|
+
expect(assigns(:posts)).to match_array posts
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
describe 'GET #live' do
|
29
|
+
subject { get :live }
|
30
|
+
|
31
|
+
it { is_expected.to be_successful }
|
32
|
+
it { is_expected.to render_template :index }
|
33
|
+
it {
|
34
|
+
subject
|
35
|
+
expect(assigns(:posts)).to match_array live_posts
|
36
|
+
}
|
37
|
+
it {
|
38
|
+
subject
|
39
|
+
expect(assigns(:posts)).to_not match_array draft_posts
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'GET #draft' do
|
44
|
+
subject { get :draft }
|
45
|
+
|
46
|
+
it { is_expected.to be_successful }
|
47
|
+
it { is_expected.to render_template :index }
|
48
|
+
it {
|
49
|
+
subject
|
50
|
+
expect(assigns(:posts)).to match_array draft_posts
|
51
|
+
}
|
52
|
+
it {
|
53
|
+
subject
|
54
|
+
expect(assigns(:posts)).to_not match_array live_posts
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
describe 'GET #future' do
|
59
|
+
let(:past_posts) do
|
60
|
+
create_list(:spina_blog_post, 3, published_at: Time.zone.today - 10)
|
61
|
+
end
|
62
|
+
let(:future_posts) do
|
63
|
+
create_list(:spina_blog_post, 3, published_at: Time.zone.today + 10)
|
64
|
+
end
|
65
|
+
|
66
|
+
subject { get :future }
|
67
|
+
|
68
|
+
it { is_expected.to be_successful }
|
69
|
+
it { is_expected.to render_template :index }
|
70
|
+
it {
|
71
|
+
subject
|
72
|
+
expect(assigns(:posts)).to match_array future_posts
|
73
|
+
}
|
74
|
+
it {
|
75
|
+
subject
|
76
|
+
expect(assigns(:posts)).to_not match_array past_posts
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
describe 'GET #new' do
|
81
|
+
subject { get :new }
|
82
|
+
|
83
|
+
it { is_expected.to be_successful }
|
84
|
+
it { is_expected.to render_template :new }
|
85
|
+
end
|
86
|
+
|
87
|
+
describe 'POST #create' do
|
88
|
+
subject { post :create, params: { post: post_attributes } }
|
89
|
+
|
90
|
+
it { is_expected.to have_http_status :redirect }
|
91
|
+
it {
|
92
|
+
subject
|
93
|
+
expect(flash[:notice]).to eq 'Post saved'
|
94
|
+
}
|
95
|
+
it { expect { subject }.to change(Spina::Admin::Conferences::Blog::Post, :count).by(1) }
|
96
|
+
|
97
|
+
context 'with invalid attributes' do
|
98
|
+
subject { post :create, params: { post: { content: 'foo' } } }
|
99
|
+
|
100
|
+
it { is_expected.to_not have_http_status :redirect }
|
101
|
+
it { expect { subject }.to_not change(Spina::Admin::Conferences::Blog::Post, :count) }
|
102
|
+
it { is_expected.to render_template :new }
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe 'GET #edit' do
|
107
|
+
subject { get :edit, params: { id: blog_post.id } }
|
108
|
+
|
109
|
+
it { is_expected.to be_successful }
|
110
|
+
it { is_expected.to render_template :edit }
|
111
|
+
end
|
112
|
+
|
113
|
+
describe 'PATCH #update' do
|
114
|
+
subject do
|
115
|
+
patch :update, params: { id: blog_post.id, post: post_attributes }
|
116
|
+
end
|
117
|
+
|
118
|
+
it { is_expected.to have_http_status :redirect }
|
119
|
+
it do
|
120
|
+
subject
|
121
|
+
expect(flash[:notice]).to eq 'Post saved'
|
122
|
+
end
|
123
|
+
it { expect { subject }.to(change { blog_post.reload.title }) }
|
124
|
+
|
125
|
+
context 'with invalid attributes' do
|
126
|
+
subject do
|
127
|
+
patch :update, params: { id: blog_post.id, post: { title: '' } }
|
128
|
+
end
|
129
|
+
|
130
|
+
it { is_expected.to_not have_http_status :redirect }
|
131
|
+
it { is_expected.to render_template :edit }
|
132
|
+
it { expect { subject }.not_to(change { blog_post.reload.title }) }
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe 'DELETE #destroy' do
|
137
|
+
let!(:blog_post) { FactoryBot.create :spina_blog_post }
|
138
|
+
|
139
|
+
subject { delete :destroy, params: { id: blog_post.id } }
|
140
|
+
|
141
|
+
it { expect { subject }.to change(Spina::Admin::Conferences::Blog::Post, :count).by(-1) }
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context 'signed out' do
|
146
|
+
describe 'GET #index' do
|
147
|
+
subject { get :index }
|
148
|
+
it { is_expected.to have_http_status :redirect }
|
149
|
+
it { is_expected.to_not render_template :index }
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
4
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
5
|
+
|
6
|
+
require_relative 'config/application'
|
7
|
+
|
8
|
+
Rails.application.load_tasks
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
+
// You can generate new channels where WebSocket features live using the rails generate channel command.
|
3
|
+
//
|
4
|
+
//= require action_cable
|
5
|
+
//= require_self
|
6
|
+
//= require_tree ./channels
|
7
|
+
|
8
|
+
(function() {
|
9
|
+
this.App || (this.App = {});
|
10
|
+
|
11
|
+
App.cable = ActionCable.createConsumer();
|
12
|
+
|
13
|
+
}).call(this);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
|
7
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
8
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
9
|
+
</head>
|
10
|
+
|
11
|
+
<body>
|
12
|
+
<%= yield %>
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title= current_account.name
|
5
|
+
= stylesheet_link_tag 'default/application', media: 'all', 'data-turbolinks-track' => true
|
6
|
+
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
7
|
+
= csrf_meta_tags
|
8
|
+
%body
|
9
|
+
.container
|
10
|
+
= render 'default/shared/navigation'
|
11
|
+
= yield
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'pathname'
|
5
|
+
require 'fileutils'
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
# path to your application root.
|
9
|
+
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
|
10
|
+
|
11
|
+
def system!(*args)
|
12
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
13
|
+
end
|
14
|
+
|
15
|
+
chdir APP_ROOT do
|
16
|
+
# This script is a starting point to setup your application.
|
17
|
+
# Add necessary setup steps to this file.
|
18
|
+
|
19
|
+
puts '== Installing dependencies =='
|
20
|
+
system! 'gem install bundler --conservative'
|
21
|
+
system('bundle check') || system!('bundle install')
|
22
|
+
|
23
|
+
# puts "\n== Copying sample files =="
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
+
# end
|
27
|
+
|
28
|
+
puts "\n== Preparing database =="
|
29
|
+
system! 'bin/rails db:setup'
|
30
|
+
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
33
|
+
|
34
|
+
puts "\n== Restarting application server =="
|
35
|
+
system! 'bin/rails restart'
|
36
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'pathname'
|
5
|
+
require 'fileutils'
|
6
|
+
include FileUtils
|
7
|
+
|
8
|
+
# path to your application root.
|
9
|
+
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
|
10
|
+
|
11
|
+
def system!(*args)
|
12
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
13
|
+
end
|
14
|
+
|
15
|
+
chdir APP_ROOT do
|
16
|
+
# This script is a way to update your development environment automatically.
|
17
|
+
# Add necessary update steps to this file.
|
18
|
+
|
19
|
+
puts '== Installing dependencies =='
|
20
|
+
system! 'gem install bundler --conservative'
|
21
|
+
system('bundle check') || system!('bundle install')
|
22
|
+
|
23
|
+
puts "\n== Updating database =="
|
24
|
+
system! 'bin/rails db:migrate'
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! 'bin/rails log:clear tmp:clear'
|
28
|
+
|
29
|
+
puts "\n== Restarting application server =="
|
30
|
+
system! 'bin/rails restart'
|
31
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'boot'
|
4
|
+
|
5
|
+
require 'rails/all'
|
6
|
+
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
require 'spina/admin/conferences/blog'
|
9
|
+
|
10
|
+
module Dummy
|
11
|
+
class Application < Rails::Application
|
12
|
+
# Settings in config/environments/* take precedence over those specified here.
|
13
|
+
# Application configuration should go into files in config/initializers
|
14
|
+
# -- all .rb files in that directory are automatically loaded.
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
5
|
+
|
6
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
7
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
default: &default
|
3
|
+
adapter: postgresql
|
4
|
+
encoding: unicode
|
5
|
+
pool: 5
|
6
|
+
host: localhost
|
7
|
+
|
8
|
+
development:
|
9
|
+
<<: *default
|
10
|
+
database: spina_blog_development
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
<<: *default
|
17
|
+
database: spina_blog_test
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# In the development environment your application's code is reloaded on
|
7
|
+
# every request. This slows down response time but is perfect for development
|
8
|
+
# since you don't have to restart the web server when you make code changes.
|
9
|
+
config.cache_classes = false
|
10
|
+
|
11
|
+
# Do not eager load code on boot.
|
12
|
+
config.eager_load = false
|
13
|
+
|
14
|
+
# Show full error reports.
|
15
|
+
config.consider_all_requests_local = true
|
16
|
+
|
17
|
+
# Enable/disable caching. By default caching is disabled.
|
18
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
19
|
+
config.action_controller.perform_caching = true
|
20
|
+
|
21
|
+
config.cache_store = :memory_store
|
22
|
+
config.public_file_server.headers = {
|
23
|
+
'Cache-Control' => 'public, max-age=172800'
|
24
|
+
}
|
25
|
+
else
|
26
|
+
config.action_controller.perform_caching = false
|
27
|
+
|
28
|
+
config.cache_store = :null_store
|
29
|
+
end
|
30
|
+
|
31
|
+
# Don't care if the mailer can't send.
|
32
|
+
config.action_mailer.raise_delivery_errors = false
|
33
|
+
|
34
|
+
config.action_mailer.perform_caching = false
|
35
|
+
|
36
|
+
# Print deprecation notices to the Rails logger.
|
37
|
+
config.active_support.deprecation = :log
|
38
|
+
|
39
|
+
# Raise an error on page load if there are pending migrations.
|
40
|
+
config.active_record.migration_error = :page_load
|
41
|
+
|
42
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
43
|
+
# This option may cause significant delays in view rendering with a large
|
44
|
+
# number of complex assets.
|
45
|
+
config.assets.debug = true
|
46
|
+
|
47
|
+
# Suppress logger output for asset requests.
|
48
|
+
config.assets.quiet = true
|
49
|
+
|
50
|
+
# Raises error for missing translations
|
51
|
+
# config.action_view.raise_on_missing_translations = true
|
52
|
+
|
53
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
54
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
55
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
56
|
+
end
|