- 'test/controllers/notes_controller_test.rb'
- 'test/controllers/traces_controller_test.rb'
- 'test/controllers/user_blocks_controller_test.rb'
+ - 'test/system/users_test.rb'
# Offense count: 635
# This cop supports safe autocorrection (--autocorrect).
autoprefixer-rails (10.4.19.0)
execjs (~> 2)
aws-eventstream (1.3.0)
- aws-partitions (1.972.0)
- aws-sdk-core (3.203.0)
+ aws-partitions (1.976.0)
+ aws-sdk-core (3.205.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
- aws-sdk-kms (1.89.0)
- aws-sdk-core (~> 3, >= 3.203.0)
+ aws-sdk-kms (1.91.0)
+ aws-sdk-core (~> 3, >= 3.205.0)
aws-sigv4 (~> 1.5)
- aws-sdk-s3 (1.160.0)
- aws-sdk-core (~> 3, >= 3.203.0)
+ aws-sdk-s3 (1.162.0)
+ aws-sdk-core (~> 3, >= 3.205.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.9.1)
reline
htmlentities (4.3.4)
http_accept_language (2.1.1)
- i18n (1.14.5)
+ i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-js (3.9.2)
i18n (>= 0.6.6)
irb (1.14.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
- jbuilder (2.12.0)
+ jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jmespath (1.6.2)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.7.2)
- jwt (2.8.2)
+ jwt (2.9.0)
base64
kgio (2.11.4)
kramdown (2.4.0)
omniauth-github (2.0.1)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8)
- omniauth-google-oauth2 (1.1.3)
- jwt (>= 2.0)
+ omniauth-google-oauth2 (1.2.0)
+ jwt (>= 2.9)
oauth2 (~> 2.0)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8)
rexml (3.3.7)
rinku (2.0.6)
rotp (6.3.0)
- rouge (4.3.0)
+ rouge (4.4.0)
rtlcss (0.2.1)
mini_racer (>= 0.6.3)
rubocop (1.66.1)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
- rubocop-performance (1.21.1)
+ rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.26.1)
thor (1.3.2)
tilt (2.4.0)
timeout (0.4.1)
- turbo-rails (2.0.6)
+ turbo-rails (2.0.7)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
- unicode-display_width (2.5.0)
+ unicode-display_width (2.6.0)
uri (0.13.1)
validates_email_format_of (1.8.2)
i18n (>= 0.8.0)
+++ /dev/null
-<svg xmlns='http://www.w3.org/2000/svg' width='5' height='5'>
-<circle cx='2.5' cy='2.5' r='2.15' stroke='black' fill='#ffffff' />
-</svg>
+++ /dev/null
-<svg xmlns='http://www.w3.org/2000/svg' width='9' height='9'>
-<circle cx='4.5' cy='4.5' r='4' stroke='black' fill='#ffffff' />
-</svg>
+++ /dev/null
-<svg xmlns='http://www.w3.org/2000/svg' width='52' height='12' stroke='#999999' stroke-dashoffset='-1'>
- <g stroke-dasharray='2 4'>
- <line x2='100%' y1='1' y2='1' stroke-width='2' />
- <line x2='100%' y1='6' y2='6' stroke-width='4' />
- <line x2='100%' y1='11' y2='11' stroke-width='2' />
- </g>
- <line x2='100%' y1='2.5' y2='2.5' stroke-width='1' />
- <line x2='100%' y1='9.5' y2='9.5' stroke-width='1' />
-</svg>
+++ /dev/null
-<svg xmlns='http://www.w3.org/2000/svg' width='5' height='5'>
-<circle cx='2.5' cy='2.5' r='2.15' stroke='black' fill='#e23148' />
-</svg>
+++ /dev/null
-<svg xmlns='http://www.w3.org/2000/svg' width='9' height='9'>
-<circle cx='4.5' cy='4.5' r='4' stroke='black' fill='#e23148' />
-</svg>
map.attributionControl.setPrefix('');
map.removeControl(map.attributionControl);
- if (!args.layer || args.layer === "mapnik" || args.layer === "osmarender" || args.layer === "mapquest") {
- new L.OSM.Mapnik(mapnikOptions).addTo(map);
- } else if (args.layer === "cyclosm") {
+ if (args.layer === "cyclosm") {
new L.OSM.CyclOSM().addTo(map);
} else if (args.layer === "cyclemap" || args.layer === "cycle map") {
new L.OSM.CycleMap(thunderforestOptions).addTo(map);
} else if (args.layer === "transportmap") {
new L.OSM.TransportMap(thunderforestOptions).addTo(map);
- } else if (args.layer === "opnvkarte") {
- new L.OSM.OPNVKarte().addTo(map);
} else if (args.layer === "hot") {
new L.OSM.HOT().addTo(map);
+ } else {
+ new L.OSM.Mapnik(mapnikOptions).addTo(map);
}
if (args.marker) {
//= require leaflet.locatecontrol/src/L.Control.Locate
+(function () {
+ $(document).on("change", "#user_all", function () {
+ $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
+ });
+}());
+
$(document).ready(function () {
var defaultHomeZoom = 12;
var map, marker, deleted_lat, deleted_lon;
enableAuth();
}
- $("#user_all").change(function () {
- $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
- });
-
$("#content.user_confirm").each(function () {
$(this).hide();
$(this).find("#confirm").submit();
##
# wrap a web page in a timeout
def web_timeout(&block)
+ raise Timeout::Error if Settings.web_timeout.negative?
+
Timeout.timeout(Settings.web_timeout, &block)
rescue ActionView::Template::Error => e
e = e.cause
if e.is_a?(Timeout::Error) ||
(e.is_a?(ActiveRecord::StatementInvalid) && e.message.include?("execution expired"))
- ActiveRecord::Base.connection.raw_connection.cancel
- render :action => "timeout"
+ respond_to_timeout
else
raise
end
rescue Timeout::Error
+ respond_to_timeout
+ end
+
+ def respond_to_timeout
ActiveRecord::Base.connection.raw_connection.cancel
- render :action => "timeout"
+ render :action => "timeout", :status => :gateway_timeout
end
##
users = User.all
users = users.where(:status => @params[:status]) if @params[:status]
- users = users.where(:creation_ip => @params[:ip]) if @params[:ip]
+ users = users.where(:creation_address => @params[:ip]) if @params[:ip]
@users_count = users.limit(501).count
@users_count = I18n.t("count.at_least_pattern", :count => 500) if @users_count > 500
def save_new_user(email_hmac, referer = nil)
current_user.data_public = true
current_user.description = "" if current_user.description.nil?
- current_user.creation_ip = request.remote_ip
current_user.creation_address = request.remote_ip
current_user.languages = http_accept_language.user_preferred_languages
current_user.terms_agreed = Time.now.utc
max_width_for_default_padding = 35
width = 0
- pagination_items(pages, {}).each do |body|
+ pagination_items(pages, {}).each do |(body)|
width += 2 # padding width
width += body.length
end
link_classes = ["page-link", { "px-1" => width > max_width_for_default_padding }]
- tag.ul :class => "pagination pagination-sm mb-1 ms-auto" do
+ tag.ul :class => "pagination pagination-sm mb-2" do
pagination_items(pages, {}).each do |body, page_or_class|
linked = !(page_or_class.is_a? String)
link = if linked
# pass_salt :string
# email_valid :boolean default(FALSE), not null
# new_email :string
-# creation_ip :string
# languages :string
# status :enum default("pending"), not null
# terms_agreed :datetime
require "digest"
include AASM
+ self.ignored_columns += ["creation_ip"]
+
has_many :traces, -> { where(:visible => true) }
has_many :diary_entries, -> { order(:created_at => :desc) }, :inverse_of => :user
has_many :diary_comments, -> { order(:created_at => :desc) }, :inverse_of => :user
+++ /dev/null
-atom_feed(:language => I18n.locale, :schema_date => 2009,
- :id => url_for(params.merge(:only_path => false)),
- :root_url => url_for(params.merge(:only_path => false, :format => nil)),
- "xmlns:georss" => "http://www.georss.org/georss") do |feed|
- feed.title @title
-
- feed.subtitle :type => "xhtml" do |xhtml|
- xhtml.p do |p|
- p << t(".sorry")
- end
- end
-end
+++ /dev/null
-<p><%= t ".sorry" %></p>
--- /dev/null
+xml.rss("version" => "2.0",
+ "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
+ xml.channel do
+ if params[:changeset_id]
+ xml.title t("changeset_comments.feeds.show.title_particular", :changeset_id => params[:changeset_id])
+ else
+ xml.title t("changeset_comments.feeds.show.title_all")
+ end
+ xml.link root_url
+ xml.description t(".sorry")
+ end
+end
-<div class="d-flex flex-wrap gap-2">
- <h4 class="fs-5 mb-0"><%= type_and_paginated_count(type, pages) %></h4>
- <% if pages.page_count > 1 %>
- <%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
- {
- :title => type_and_paginated_count(type, pages, page),
- :data => { :turbo => "true" }
- }
- end %>
- <% end %>
-</div>
+<h4 class="fs-5"><%= type_and_paginated_count(type, pages) %></h4>
+<% if pages.page_count > 1 %>
+ <%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
+ {
+ :title => type_and_paginated_count(type, pages, page),
+ :data => { :turbo => "true" }
+ }
+ end %>
+<% end %>
--- /dev/null
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
--- /dev/null
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
--- /dev/null
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
--- /dev/null
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
--- /dev/null
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
+<p><%= t ".hi", :to_user => @friendship.befriendee.display_name %></p>
+
<p><%= t ".had_added_you", :user => @friendship.befriender.display_name %></p>
<%= message_body do %>
+<%= t ".hi", :to_user => @friendship.befriendee.display_name %>
+
<%= t '.had_added_you', :user => @friendship.befriender.display_name %>
<%= t '.see_their_profile', :userurl => @viewurl %>
</td>
<td>
<p>
- <% if user.creation_ip %>
+ <% if user.creation_address %>
<%= t "users.index.summary_html",
:name => link_to(user.display_name, user),
- :ip_address => link_to(user.creation_ip, :ip => user.creation_ip),
+ :ip_address => link_to(user.creation_address, :ip => user.creation_address),
:date => l(user.created_at, :format => :friendly) %>
<% else %>
<%= t "users.index.summary_no_ip_html",
<%= link_to t(".comments"), diary_comments_path(@user) %>
<span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
</li>
- <li>
- <% if current_user and current_user.friends_with?(@user) %>
- <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
- <% elsif current_user %>
- <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
- <% else %>
- <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name) %>
- <% end %>
- </li>
+ <% if current_user %>
+ <li>
+ <% if current_user.friends_with?(@user) %>
+ <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
+ <% else %>
+ <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
+ <% end %>
+ </li>
+ <% end %>
<% if @user.blocks.exists? %>
<li>
<dl class="list-inline">
<dt class="list-inline-item m-0"><%= t ".email address" %></dt>
<dd class="list-inline-item"><%= @user.email %></dd>
- <% unless @user.creation_ip.nil? -%>
+ <% unless @user.creation_address.nil? -%>
<dt class="list-inline-item m-0"><%= t ".created from" %></dt>
- <dd class="list-inline-item"><%= link_to @user.creation_ip, users_path(:ip => @user.creation_ip) %></dd>
+ <dd class="list-inline-item"><%= link_to @user.creation_address, users_path(:ip => @user.creation_address) %></dd>
<% end -%>
<dt class="list-inline-item m-0"><%= t ".status" %></dt>
<dd class="list-inline-item"><%= link_to @user.status.capitalize, users_path(:status => @user.status) %></dd>
--- /dev/null
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
- 'geocoder.search_osm_nominatim.prefix.*'
- 'javascripts.*'
- 'doorkeeper.*'
+ - 'users.auth_failure.*' # OmniAuth provider callback error messages
- 'activerecord.attributes.*'
- 'activerecord.models.*'
- 'activerecord.help.*'
- { min_zoom: 15, name: bicycle_parking, image: bicycle_parking.png }
- { min_zoom: 16, name: bicycle_parking_small, image: bicycle_parking_small.svg }
- { min_zoom: 16, name: toilets, image: toilets.png }
-opnvkarte:
- - { min_zoom: 6, name: rail, width: 52, height: 1, fill: "#868686" }
- - { min_zoom: 8, name: rail, width: 52, height: 2, fill: "#868686" }
- - { min_zoom: 11, name: rail, width: 52, height: 3, fill: "#868686", line: "#eeeeee", line-dasharray: 10, line-dashoffset: 9 }
- - { min_zoom: 15, name: rail, width: 52, height: 4, fill: "#868686", line: "#eeeeee", line-dasharray: 10, line-dashoffset: 9, line-width: 2 }
- - { min_zoom: 17, name: rail, image: rail17.svg }
- - { min_zoom: 6, name: train, width: 52, height: 2, fill: "#ffc366" }
- - { min_zoom: 10, name: train, width: 52, height: 3, fill: "#ffc366" }
- - { min_zoom: 12, name: train, width: 52, height: 4, fill: "#ffc366" }
- - { min_zoom: 14, name: train, width: 52, height: 8, fill: "#ffc366" }
- - { min_zoom: 16, name: train, width: 52, height: 10, fill: "#ffc366" }
- - { min_zoom: 10, name: light_rail, width: 52, height: 3, fill: "#66ff66" }
- - { min_zoom: 12, name: light_rail, width: 52, height: 4, fill: "#66ff66" }
- - { min_zoom: 14, name: light_rail, width: 52, height: 8, fill: "#66ff66" }
- - { min_zoom: 16, name: light_rail, width: 52, height: 10, fill: "#66ff66" }
- - { min_zoom: 10, name: tram, width: 52, height: 3, fill: "#3333fe" }
- - { min_zoom: 12, name: tram, width: 52, height: 4, fill: "#3333fe" }
- - { min_zoom: 14, name: tram, width: 52, height: 8, fill: "#3333fe" }
- - { min_zoom: 16, name: tram, width: 52, height: 10, fill: "#3333fe" }
- - { min_zoom: 10, name: subway, width: 52, height: 3, fill: "#33339f" }
- - { min_zoom: 12, name: subway, width: 52, height: 4, fill: "#33339f" }
- - { min_zoom: 14, name: subway, width: 52, height: 8, fill: "#33339f" }
- - { min_zoom: 16, name: subway, width: 52, height: 10, fill: "#33339f" }
- - { min_zoom: 9, name: ferry, width: 52, height: 2, fill: "#9f339f" }
- - { min_zoom: 14, name: ferry, width: 52, height: 3, fill: "#9f339f" }
- - { min_zoom: 10, name: trolleybus, width: 52, height: 3, fill: "#9f3333" }
- - { min_zoom: 12, name: trolleybus, width: 52, height: 4, fill: "#9f3333" }
- - { min_zoom: 14, name: trolleybus, width: 52, height: 8, fill: "#9f3333" }
- - { min_zoom: 16, name: trolleybus, width: 52, height: 10, fill: "#9f3333" }
- - { min_zoom: 11, name: bus, width: 52, height: 1, fill: "#fe3333" }
- - { min_zoom: 12, name: bus, width: 52, height: 2, fill: "#fe3333" }
- - { min_zoom: 13, name: bus, width: 52, height: 3, fill: "#fe3333" }
- - { min_zoom: 14, name: bus, width: 52, height: 4, fill: "#fe3333" }
- - { min_zoom: 16, name: bus, width: 52, height: 10, fill: "#fe3333" }
- - { min_zoom: 13, name: bus_stop, image: bus_stop13.svg }
- - { min_zoom: 15, name: bus_stop, image: bus_stop15.svg }
- - { min_zoom: 13, name: stop, image: stop13.svg }
- - { min_zoom: 15, name: stop, image: stop15.svg }
- - { min_zoom: 8, name: motorway, width: 52, height: 4, fill: "#dddddd", casing: "#6d6d6d" }
- - { min_zoom: 13, name: motorway, width: 52, height: 8, fill: "#dddddd", casing: "#6d6d6d" }
- - { min_zoom: 15, name: motorway, width: 52, height: 13, fill: "#dddddd", casing: "#6d6d6d", line: "#ffffff", line-dasharray: 12, line-dashoffset: 4 }
- - { min_zoom: 17, name: motorway, width: 52, height: 17, fill: "#dddddd", casing: "#6d6d6d", line: "#ffffff", line-dasharray: 12, line-dashoffset: 4, casing-width: 2 }
- - { min_zoom: 8, name: main_road, width: 52, height: 1, fill: "#5c6d6d88" }
- - { min_zoom: 11, name: main_road, width: 52, height: 4, fill: "#dddddd", casing: "#a1968b" }
- - { min_zoom: 13, name: main_road, width: 52, height: 8, fill: "#dddddd", casing: "#a1968b" }
- - { min_zoom: 15, name: main_road, width: 52, height: 13, fill: "#dddddd", casing: "#a1968b" }
- - { min_zoom: 17, name: main_road, width: 52, height: 17, fill: "#dddddd", casing: "#a1968b" }
- # landcover
- - { min_zoom: 0, name: [lake, reservoir], width: 26, height: 10, fill: "#a1cbea" }
- - { min_zoom: 8, name: [lake, reservoir], width: 26, height: 10, fill: "#bfd3ef" }
- - { min_zoom: 4, name: [forest, wood], width: 26, height: 10, fill: "#b9c5a3" }
- - { min_zoom: 4, name: built_up, width: 26, height: 10, fill: "#d8d8d8" }
- - { min_zoom: 9, name: farmland, width: 26, height: 10, fill: "#eae8d6" }
- - { min_zoom: 12, name: [park, allotments], width: 26, height: 10, fill: "#c2d89a" }
note: note
timeout:
title: Timeout Error
- sorry: "Sorry, the data for the %{type} with the id %{id}, took too long to retrieve."
+ sorry: "Sorry, the data for the %{type} with the id %{id} took too long to retrieve."
type:
node: node
way: way
introduction: "Click on the map to find nearby features."
nearby: "Nearby features"
enclosing: "Enclosing features"
+ nodes:
+ timeout:
+ sorry: "Sorry, the data for the node with the id %{id} took too long to retrieve."
old_nodes:
not_found:
sorry: "Sorry, node #%{id} version %{version} could not be found."
+ timeout:
+ sorry: "Sorry, the history of the node with the id %{id} took too long to retrieve."
+ ways:
+ timeout:
+ sorry: "Sorry, the data for the way with the id %{id} took too long to retrieve."
old_ways:
not_found:
sorry: "Sorry, way #%{id} version %{version} could not be found."
+ timeout:
+ sorry: "Sorry, the history of the way with the id %{id} took too long to retrieve."
+ relations:
+ timeout:
+ sorry: "Sorry, the data for the relation with the id %{id} took too long to retrieve."
old_relations:
not_found:
sorry: "Sorry, relation #%{id} version %{version} could not be found."
+ timeout:
+ sorry: "Sorry, the history of the relation with the id %{id} took too long to retrieve."
changeset_comments:
feeds:
comment:
level9: "Village Boundary"
level10: "Suburb Boundary"
level11: "Neighbourhood Boundary"
- types:
- cities: Cities
- towns: Towns
- places: Places
results:
no_results: "No results found"
more_results: "More results"
changeset_comment_notification:
description: "OpenStreetMap Changeset #%{id}"
hi: "Hi %{to_user},"
- greeting: "Hi,"
commented:
subject_own: "[OpenStreetMap] %{commenter} has commented on one of your changesets"
subject_other: "[OpenStreetMap] %{commenter} has commented on a changeset you are interested in"
destination: "Destination access"
construction: "Roads under construction"
bus_stop: "Bus stop"
- stop: "Stop"
bicycle_shop: "Bicycle shop"
bicycle_rental: "Bicycle rental"
bicycle_parking: "Bicycle parking"
contributor_terms_url: "https://wiki.osmfoundation.org/wiki/Licence/Contributor_Terms"
contributor_terms: "contributor terms"
tou: "terms of use"
- external auth: "Third Party Authentication:"
continue: Sign Up
terms accepted: "Thanks for accepting the new contributor terms!"
email_help:
--- /dev/null
+class BackfillUserCreationAddress < ActiveRecord::Migration[7.1]
+ class User < ApplicationRecord
+ end
+
+ def up
+ User
+ .where(:creation_address => nil)
+ .where.not(:creation_ip => nil)
+ .in_batches(:of => 1000)
+ .update_all("creation_address = creation_ip::inet")
+ end
+
+ def down; end
+end
--- /dev/null
+class DropUserCreationIp < ActiveRecord::Migration[7.1]
+ def change
+ safety_assured { remove_column :users, :creation_ip, :string }
+ end
+end
pass_salt character varying,
email_valid boolean DEFAULT false NOT NULL,
new_email character varying,
- creation_ip character varying,
languages character varying,
status public.user_status_enum DEFAULT 'pending'::public.user_status_enum NOT NULL,
terms_agreed timestamp without time zone,
('23'),
('22'),
('21'),
+('20240913171951'),
+('20240912181413'),
('20240910175616'),
('20240822121603'),
('20240813070506'),
:status => %w[suspended deleted],
:creation_time => Time.now.utc - 28.days..Time.now.utc
},
- :group => :creation_ip
+ :group => :creation_address
)
addresses.each do |address, count|
get changesets_comments_feed_path(:format => "rss", :limit => 100001)
assert_response :bad_request
end
+
+ def test_feed_timeout
+ with_settings(:web_timeout => -1) do
+ get changesets_comments_feed_path
+ end
+ assert_response :error
+ assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
+ assert_dom "rss>channel>title", :text => "OpenStreetMap changeset discussion"
+ assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
+ end
+
+ def test_feed_changeset_timeout
+ with_settings(:web_timeout => -1) do
+ get changeset_comments_feed_path(123)
+ end
+ assert_response :error
+ assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
+ assert_dom "rss>channel>title", :text => "OpenStreetMap changeset #123 discussion"
+ assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
+ end
end
end
assert_select ".secondary-actions a", :text => "View History", :count => 1
assert_select ".secondary-actions a", :text => "View Unredacted History", :count => 1
end
+
+ def test_show_timeout
+ node = create(:node)
+ with_settings(:web_timeout => -1) do
+ get node_path(node)
+ end
+ assert_response :error
+ assert_template :layout => "map"
+ assert_dom "h2", "Timeout Error"
+ assert_dom "p", /#{Regexp.quote("the node with the id #{node.id}")}/
+ end
end
assert_select "#sidebar_content", /node #0 version 0 could not be found/
end
+ def test_show_timeout
+ node = create(:node, :with_history)
+ with_settings(:web_timeout => -1) do
+ get old_node_path(node, 1)
+ end
+ assert_response :error
+ assert_template :layout => "map"
+ assert_dom "h2", "Timeout Error"
+ assert_dom "p", /#{Regexp.quote("the node with the id #{node.id}")}/
+ end
+
private
def create_redacted_node
assert_select "#sidebar_content", /relation #0 version 0 could not be found/
end
+ def test_show_timeout
+ relation = create(:relation, :with_history)
+ with_settings(:web_timeout => -1) do
+ get old_relation_path(relation, 1)
+ end
+ assert_response :error
+ assert_template :layout => "map"
+ assert_dom "h2", "Timeout Error"
+ assert_dom "p", /#{Regexp.quote("the relation with the id #{relation.id}")}/
+ end
+
private
def create_redacted_relation
assert_select "#sidebar_content", /way #0 version 0 could not be found/
end
+ def test_show_timeout
+ way = create(:way, :with_history)
+ with_settings(:web_timeout => -1) do
+ get old_way_path(way, 1)
+ end
+ assert_response :error
+ assert_template :layout => "map"
+ assert_dom "h2", "Timeout Error"
+ assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
+ end
+
private
def create_redacted_way
sidebar_browse_check :relation_path, member.id, "browse/feature"
assert_select "a[href='#{relation_path relation}']", :count => 1
end
+
+ def test_show_timeout
+ relation = create(:relation)
+ with_settings(:web_timeout => -1) do
+ get relation_path(relation)
+ end
+ assert_response :error
+ assert_template :layout => "map"
+ assert_dom "h2", "Timeout Error"
+ assert_dom "p", /#{Regexp.quote("the relation with the id #{relation.id}")}/
+ end
end
moderator_user = create(:moderator_user)
administrator_user = create(:administrator_user)
_suspended_user = create(:user, :suspended)
- _ip_user = create(:user, :creation_ip => "1.2.3.4")
+ _ip_user = create(:user, :creation_address => "1.2.3.4")
# There are now 7 users - the five above, plus two extra "granters" for the
# moderator_user and administrator_user
sidebar_browse_check :way_path, member.id, "browse/feature"
assert_select "a[href='#{relation_path relation}']", :count => 1
end
+
+ def test_show_timeout
+ way = create(:way)
+ with_settings(:web_timeout => -1) do
+ get way_path(way)
+ end
+ assert_response :error
+ assert_template :layout => "map"
+ assert_dom "h2", "Timeout Error"
+ assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
+ end
end
--- /dev/null
+require "application_system_test_case"
+
+class UsersTest < ApplicationSystemTestCase
+ def setup
+ admin = create(:administrator_user)
+ sign_in_as(admin)
+ end
+
+ test "all users can be selected" do
+ create_list(:user, 100)
+
+ visit users_path
+
+ assert_css "tbody input[type=checkbox]:checked", :count => 0
+ assert_css "tbody input[type=checkbox]:not(:checked)", :count => 50
+ check "user_all"
+ assert_css "tbody input[type=checkbox]:checked", :count => 50
+ assert_css "tbody input[type=checkbox]:not(:checked)", :count => 0
+
+ click_on "Older Users", :match => :first
+
+ assert_css "tbody input[type=checkbox]:checked", :count => 0
+ assert_css "tbody input[type=checkbox]:not(:checked)", :count => 50
+ check "user_all"
+ assert_css "tbody input[type=checkbox]:checked", :count => 50
+ assert_css "tbody input[type=checkbox]:not(:checked)", :count => 0
+ end
+end