adds pages controller for static pages
This commit is contained in:
19
app/controllers/pages_controller.rb
Normal file
19
app/controllers/pages_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
class PagesController < ApplicationController
|
||||||
|
|
||||||
|
skip_authorization_check
|
||||||
|
|
||||||
|
def privacy
|
||||||
|
end
|
||||||
|
|
||||||
|
def legal
|
||||||
|
end
|
||||||
|
|
||||||
|
def terms
|
||||||
|
end
|
||||||
|
|
||||||
|
def transparency
|
||||||
|
end
|
||||||
|
|
||||||
|
def opendata
|
||||||
|
end
|
||||||
|
end
|
||||||
1
app/views/pages/legal.html.erb
Normal file
1
app/views/pages/legal.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= t('pages.legal') %>
|
||||||
1
app/views/pages/opendata.html.erb
Normal file
1
app/views/pages/opendata.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= t('pages.opendata') %>
|
||||||
1
app/views/pages/privacy.html.erb
Normal file
1
app/views/pages/privacy.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= t('pages.privacy') %>
|
||||||
1
app/views/pages/terms.html.erb
Normal file
1
app/views/pages/terms.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= t('pages.terms') %>
|
||||||
1
app/views/pages/transparency.html.erb
Normal file
1
app/views/pages/transparency.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%= t('pages.transparency') %>
|
||||||
@@ -26,6 +26,7 @@ data:
|
|||||||
- config/locales/moderation.%{locale}.yml
|
- config/locales/moderation.%{locale}.yml
|
||||||
- config/locales/verification.%{locale}.yml
|
- config/locales/verification.%{locale}.yml
|
||||||
- config/locales/mailers.%{locale}.yml
|
- config/locales/mailers.%{locale}.yml
|
||||||
|
- config/locales/pages.%{locale}.yml
|
||||||
- config/locales/devise_views.%{locale}.yml
|
- config/locales/devise_views.%{locale}.yml
|
||||||
- config/locales/responders.%{locale}.yml
|
- config/locales/responders.%{locale}.yml
|
||||||
- config/locales/kaminari.%{locale}.yml
|
- config/locales/kaminari.%{locale}.yml
|
||||||
|
|||||||
12
config/locales/pages.en.yml
Normal file
12
config/locales/pages.en.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
en:
|
||||||
|
pages:
|
||||||
|
legal:
|
||||||
|
"Legal"
|
||||||
|
privacy:
|
||||||
|
"Privacy"
|
||||||
|
terms:
|
||||||
|
"Terms and Conditions"
|
||||||
|
transparency:
|
||||||
|
"Transparency"
|
||||||
|
opendata:
|
||||||
|
"Open Data"
|
||||||
12
config/locales/pages.es.yml
Normal file
12
config/locales/pages.es.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
es:
|
||||||
|
pages:
|
||||||
|
legal:
|
||||||
|
"Legal"
|
||||||
|
privacy:
|
||||||
|
"Privacidad"
|
||||||
|
terms:
|
||||||
|
"Términos y Condiciones"
|
||||||
|
transparency:
|
||||||
|
"Transparencia"
|
||||||
|
opendata:
|
||||||
|
"Datos abiertos"
|
||||||
@@ -175,4 +175,8 @@ Rails.application.routes.draw do
|
|||||||
if Rails.env.development?
|
if Rails.env.development?
|
||||||
mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
mount LetterOpenerWeb::Engine, at: "/letter_opener"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# static pages
|
||||||
|
get "/:action", controller: "pages"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
34
spec/controllers/pages_controller_spec.rb
Normal file
34
spec/controllers/pages_controller_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe PagesController do
|
||||||
|
|
||||||
|
describe 'Static pages' do
|
||||||
|
it 'should include a privacy page' do
|
||||||
|
get :privacy
|
||||||
|
expect(response).to be_ok
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should include a legal page' do
|
||||||
|
get :legal
|
||||||
|
expect(response).to be_ok
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should include a terms page' do
|
||||||
|
get :terms
|
||||||
|
expect(response).to be_ok
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'Provisional pages' do
|
||||||
|
it 'should include a transparency page' do
|
||||||
|
get :transparency
|
||||||
|
expect(response).to be_ok
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should include a opendata page' do
|
||||||
|
get :opendata
|
||||||
|
expect(response).to be_ok
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user