Skip to content

Commit

Permalink
Privacy policy (GDPR)
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed May 25, 2018
1 parent 3fb1ed3 commit 7ad2081
Show file tree
Hide file tree
Showing 7 changed files with 230 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/web/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
# get '/hello', to: ->(env) { [200, {}, ['Hello from Hanami!']] }
get '/contributors/:id', to: 'contributors#show'
root to: 'contributors#index'
get '/privacy', to: 'privacy#show'
8 changes: 8 additions & 0 deletions apps/web/controllers/privacy/show.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Web::Controllers::Privacy
class Show
include Web::Action

def call(params)
end
end
end
195 changes: 195 additions & 0 deletions apps/web/templates/privacy/show.html.slim

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions apps/web/templates/shared/_header.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ h2 = title
a href='http://hanamirb.org' target='_blank' Main site
li role="presentation"
a href='https://github.com/hanami/contributors' target='_blank' Source
li role="presentation"
a href='/privacy' Privacy
5 changes: 5 additions & 0 deletions apps/web/views/privacy/show.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Web::Views::Privacy
class Show
include Web::View
end
end
9 changes: 9 additions & 0 deletions spec/web/controllers/privacy/show_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
RSpec.describe Web::Controllers::Privacy::Show, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }

it 'is successful' do
response = action.call(params)
expect(response[0]).to eq 200
end
end
10 changes: 10 additions & 0 deletions spec/web/views/privacy/show_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
RSpec.describe Web::Views::Privacy::Show, type: :view do
let(:exposures) { Hash[format: :html] }
let(:template) { Hanami::View::Template.new('apps/web/templates/privacy/show.html.slim') }
let(:view) { described_class.new(template, exposures) }
let(:rendered) { view.render }

it 'exposes #format' do
expect(view.format).to eq exposures.fetch(:format)
end
end

0 comments on commit 7ad2081

Please sign in to comment.