if user&.active?
can :welcome, :site
- can :read, [:deletion, :account_terms]
+ can :read, [:deletion, :account_terms, :account_pd_declaration]
if Settings.status != "database_offline"
can [:subscribe, :unsubscribe], Changeset
--- /dev/null
+module Accounts
+ class PdDeclarationsController < ApplicationController
+ layout "site"
+
+ before_action :authorize_web
+ before_action :set_locale
+
+ authorize_resource :class => :account_pd_declaration
+
+ def show; end
+ end
+end
--- /dev/null
+<% content_for :heading do %>
+ <h1><%= t ".title" %></h1>
+<% end %>
terms_declined_html: We are sorry that you have decided to not accept the new Contributor Terms. For more information, please see %{terms_declined_link}.
terms_declined_link: this wiki page
terms_declined_url: https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined
+ pd_declarations:
+ show:
+ title: Consider my contributions to be in the Public Domain
browse:
deleted_ago_by_html: "Deleted %{time_ago} by %{user}"
edited_ago_by_html: "Edited %{time_ago} by %{user}"
resource :account, :only => [:edit, :update, :destroy] do
scope :module => :accounts do
resource :terms, :only => [:show, :update]
+ resource :pd_declaration, :only => :show
resource :deletion, :only => :show
end
end
--- /dev/null
+require "test_helper"
+
+module Accounts
+ class PdDeclarationsControllerTest < ActionDispatch::IntegrationTest
+ ##
+ # test all routes which lead to this controller
+ def test_routes
+ assert_routing(
+ { :path => "/account/pd_declaration", :method => :get },
+ { :controller => "accounts/pd_declarations", :action => "show" }
+ )
+ end
+
+ def test_show_not_logged_in
+ get account_pd_declaration_path
+
+ assert_redirected_to login_path(:referer => account_pd_declaration_path)
+ end
+
+ def test_show_agreed
+ user = create(:user)
+ session_for(user)
+
+ get account_pd_declaration_path
+
+ assert_response :success
+ end
+ end
+end