remote: https://rubygems.org/
specs:
SystemTimer (1.2.3)
- aasm (5.0.1)
+ aasm (5.0.2)
concurrent-ruby (~> 1.0)
- actioncable (5.2.2)
- actionpack (= 5.2.2)
+ actioncable (5.2.2.1)
+ actionpack (= 5.2.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailer (5.2.2)
- actionpack (= 5.2.2)
- actionview (= 5.2.2)
- activejob (= 5.2.2)
+ actionmailer (5.2.2.1)
+ actionpack (= 5.2.2.1)
+ actionview (= 5.2.2.1)
+ activejob (= 5.2.2.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (5.2.2)
- actionview (= 5.2.2)
- activesupport (= 5.2.2)
+ actionpack (5.2.2.1)
+ actionview (= 5.2.2.1)
+ activesupport (= 5.2.2.1)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-page_caching (1.1.1)
actionpack (>= 4.0.0, < 6)
- actionview (5.2.2)
- activesupport (= 5.2.2)
+ actionview (5.2.2.1)
+ activesupport (= 5.2.2.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_record_union (1.3.0)
activerecord (>= 4.0)
- activejob (5.2.2)
- activesupport (= 5.2.2)
+ activejob (5.2.2.1)
+ activesupport (= 5.2.2.1)
globalid (>= 0.3.6)
- activemodel (5.2.2)
- activesupport (= 5.2.2)
- activerecord (5.2.2)
- activemodel (= 5.2.2)
- activesupport (= 5.2.2)
+ activemodel (5.2.2.1)
+ activesupport (= 5.2.2.1)
+ activerecord (5.2.2.1)
+ activemodel (= 5.2.2.1)
+ activesupport (= 5.2.2.1)
arel (>= 9.0)
- activestorage (5.2.2)
- actionpack (= 5.2.2)
- activerecord (= 5.2.2)
+ activestorage (5.2.2.1)
+ actionpack (= 5.2.2.1)
+ activerecord (= 5.2.2.1)
marcel (~> 0.3.1)
- activesupport (5.2.2)
+ activesupport (5.2.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
bigdecimal (1.1.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
- bootsnap (1.4.0)
+ bootsnap (1.4.1)
msgpack (~> 1.0)
browser (2.5.3)
builder (3.2.3)
coffee-script-source (1.12.2)
composite_primary_keys (11.1.0)
activerecord (~> 5.2.1)
- concurrent-ruby (1.1.4)
+ concurrent-ruby (1.1.5)
+ config (1.7.1)
+ activesupport (>= 3.0)
+ deep_merge (~> 1.2.1)
+ dry-validation (>= 0.12.2)
coveralls (0.8.22)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
crass (1.0.4)
dalli (2.7.9)
debug_inspector (0.0.3)
+ deep_merge (1.2.1)
delayed_job (4.1.5)
activesupport (>= 3.0, < 5.3)
delayed_job_active_record (4.1.3)
activerecord (>= 3.0, < 5.3)
delayed_job (>= 3.0, < 5)
docile (1.3.1)
+ dry-configurable (0.8.2)
+ concurrent-ruby (~> 1.0)
+ dry-core (~> 0.4, >= 0.4.7)
+ dry-container (0.7.0)
+ concurrent-ruby (~> 1.0)
+ dry-configurable (~> 0.1, >= 0.1.3)
+ dry-core (0.4.7)
+ concurrent-ruby (~> 1.0)
+ dry-equalizer (0.2.2)
+ dry-inflector (0.1.2)
+ dry-logic (0.5.0)
+ dry-container (~> 0.2, >= 0.2.6)
+ dry-core (~> 0.2)
+ dry-equalizer (~> 0.2)
+ dry-types (0.14.0)
+ concurrent-ruby (~> 1.0)
+ dry-container (~> 0.3)
+ dry-core (~> 0.4, >= 0.4.4)
+ dry-equalizer (~> 0.2)
+ dry-inflector (~> 0.1, >= 0.1.2)
+ dry-logic (~> 0.5, >= 0.5)
+ dry-validation (0.13.0)
+ concurrent-ruby (~> 1.0)
+ dry-configurable (~> 0.1, >= 0.1.3)
+ dry-core (~> 0.2, >= 0.2.1)
+ dry-equalizer (~> 0.2)
+ dry-logic (~> 0.5, >= 0.5.0)
+ dry-types (~> 0.14, >= 0.14)
dynamic_form (1.1.4)
erubi (1.8.0)
execjs (2.7.0)
exifr (1.3.6)
- factory_bot (5.0.0)
+ factory_bot (5.0.2)
activesupport (>= 4.2.0)
factory_bot_rails (5.0.1)
factory_bot (~> 5.0.0)
railties (>= 4.2.0)
- fakefs (0.19.1)
+ fakefs (0.20.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
- ffi (1.9.25)
+ ffi (1.10.0)
fspath (3.1.0)
gd2-ffij (0.3.0)
ffi (>= 1.0.0)
execjs (>= 1.4.0)
multi_json (~> 1.0)
therubyracer (~> 0.12.1)
- json (2.1.0)
+ json (2.2.0)
jsonify (0.3.1)
multi_json (~> 1.0)
jsonify-rails (0.3.2)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
- msgpack (1.2.6)
+ msgpack (1.2.9)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
omniauth-github (1.3.0)
omniauth (~> 1.5)
omniauth-oauth2 (>= 1.4.0, < 2.0)
- omniauth-google-oauth2 (0.6.0)
+ omniauth-google-oauth2 (0.6.1)
jwt (>= 2.0)
omniauth (>= 1.1.1)
omniauth-oauth2 (>= 1.5)
mime-types
mimemagic (~> 0.3.0)
terrapin (~> 0.6.0)
- parallel (1.13.0)
+ parallel (1.14.0)
parser (2.6.0.0)
ast (~> 2.4.0)
pg (0.21.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-uri_sanitizer (0.0.2)
- rails (5.2.2)
- actioncable (= 5.2.2)
- actionmailer (= 5.2.2)
- actionpack (= 5.2.2)
- actionview (= 5.2.2)
- activejob (= 5.2.2)
- activemodel (= 5.2.2)
- activerecord (= 5.2.2)
- activestorage (= 5.2.2)
- activesupport (= 5.2.2)
+ rails (5.2.2.1)
+ actioncable (= 5.2.2.1)
+ actionmailer (= 5.2.2.1)
+ actionpack (= 5.2.2.1)
+ actionview (= 5.2.2.1)
+ activejob (= 5.2.2.1)
+ activemodel (= 5.2.2.1)
+ activerecord (= 5.2.2.1)
+ activestorage (= 5.2.2.1)
+ activesupport (= 5.2.2.1)
bundler (>= 1.3.0)
- railties (= 5.2.2)
+ railties (= 5.2.2.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
rails-i18n (4.0.2)
i18n (~> 0.6)
rails (>= 4.0)
- railties (5.2.2)
- actionpack (= 5.2.2)
- activesupport (= 5.2.2)
+ railties (5.2.2.1)
+ actionpack (= 5.2.2.1)
+ activesupport (= 5.2.2.1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
request_store (1.4.1)
rack (>= 1.4)
rinku (2.0.4)
- rotp (4.0.2)
+ rotp (4.1.0)
addressable (~> 2.5)
- rubocop (0.64.0)
+ rubocop (0.65.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
+ psych (>= 3.1.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
ruby-openid (2.7.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
- safe_yaml (1.0.4)
+ safe_yaml (1.0.5)
sanitize (5.0.0)
crass (~> 1.0.2)
nokogiri (>= 1.8.0)
nokogumbo (~> 2.0)
- sassc (2.0.0)
- ffi (~> 1.9.6)
+ sassc (2.0.1)
+ ffi (~> 1.9)
rake
sassc-rails (2.1.0)
railties (>= 4.0.0)
sprockets (> 3.0)
sprockets-rails
tilt
- secure_headers (6.0.0)
+ secure_headers (6.1.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
capybara (~> 2.13)
coffee-rails (~> 4.2)
composite_primary_keys (~> 11.1.0)
+ config
coveralls
dalli
delayed_job_active_record
r2 (~> 0.2.7)
rack-cors
rack-uri_sanitizer
- rails (= 5.2.2)
+ rails (= 5.2.2.1)
rails-controller-testing
rails-i18n (~> 4.0.0)
record_tag_helper
get :show, :params => { :id => changeset_id }
assert_response :success, "cannot get first changeset"
- assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "osm[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1
assert_select "osm>changeset[id='#{changeset_id}']", 1
assert_select "osm>changeset>discussion", 0
get :show, :params => { :id => changeset_id, :include_discussion => true }
assert_response :success, "cannot get first changeset with comments"
- assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "osm[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1
assert_select "osm>changeset[id='#{changeset_id}']", 1
assert_select "osm>changeset>discussion", 1
assert_select "osm>changeset>discussion>comment", 0
get :show, :params => { :id => changeset_id, :include_discussion => true }
assert_response :success, "cannot get closed changeset with comments"
- assert_select "osm[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "osm[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1
assert_select "osm>changeset[id='#{changeset_id}']", 1
assert_select "osm>changeset>discussion", 1
assert_select "osm>changeset>discussion>comment", 3
"can't upload a simple valid creation to changeset: #{@response.body}"
# check the returned payload
- assert_select "diffResult[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "diffResult[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1
assert_select "diffResult>node", 1
assert_select "diffResult>way", 1
assert_select "diffResult>relation", 1
"can't do a conditional delete of in use objects: #{@response.body}"
# check the returned payload
- assert_select "diffResult[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "diffResult[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1
assert_select "diffResult>node", 1
assert_select "diffResult>way", 1
assert_select "diffResult>relation", 1
"can't upload a complex diff to changeset: #{@response.body}"
# check the returned payload
- assert_select "diffResult[version='#{API_VERSION}'][generator='#{GENERATOR}']", 1
+ assert_select "diffResult[version='#{Settings.api_version}'][generator='#{Settings.generator}']", 1
assert_select "diffResult>node", 1
assert_select "diffResult>way", 1
assert_select "diffResult>relation", 1
"failed to return error in XML format"
# check the returned payload
- assert_select "osmError[version='#{API_VERSION}'][generator='OpenStreetMap server']", 1
+ assert_select "osmError[version='#{Settings.api_version}'][generator='OpenStreetMap server']", 1
assert_select "osmError>status", 1
assert_select "osmError>message", 1
end
assert_template nil
# print @response.body
# FIXME: needs more assert_select tests
- assert_select "osmChange[version='#{API_VERSION}'][generator='#{GENERATOR}']" do
+ assert_select "osmChange[version='#{Settings.api_version}'][generator='#{Settings.generator}']" do
assert_select "create", :count => 5
assert_select "create>node[id='#{node.id}'][visible='#{node.visible?}'][version='#{node.version}']" do
assert_select "tag[k='#{tag.k}'][v='#{tag.v}']"
changeset = create(:changeset, :user => user)
## First try with a non-public user
- new_changeset = private_changeset.to_xml
+ new_changeset = create_changeset_xml(:user => private_user)
new_tag = XML::Node.new "tag"
new_tag["k"] = "tagtesting"
new_tag["v"] = "valuetesting"
assert_require_public_data "user with their data non-public, shouldn't be able to edit their changeset"
## Now try with the public user
- create(:changeset_tag, :changeset => changeset)
- new_changeset = changeset.to_xml
+ new_changeset = create_changeset_xml(:id => 1)
new_tag = XML::Node.new "tag"
new_tag["k"] = "tagtesting"
new_tag["v"] = "valuetesting"
assert_response :success
assert_select "osm>changeset[id='#{changeset.id}']", 1
- assert_select "osm>changeset>tag", 2
+ assert_select "osm>changeset>tag", 1
assert_select "osm>changeset>tag[k='tagtesting'][v='valuetesting']", 1
end
basic_authorization create(:user).email, "test"
changeset = create(:changeset)
- new_changeset = changeset.to_xml
+ new_changeset = create_changeset_xml(:user => changeset.user, :id => changeset.id)
new_tag = XML::Node.new "tag"
new_tag["k"] = "testing"
new_tag["v"] = "testing"
xml.find("//osm/way").first[name] = value.to_s
xml
end
+
+ ##
+ # build XML for changesets
+ def create_changeset_xml(user: nil, id: nil)
+ root = XML::Document.new
+ root.root = XML::Node.new "osm"
+ cs = XML::Node.new "changeset"
+ if user
+ cs["user"] = user.display_name
+ cs["uid"] = user.id.to_s
+ end
+ cs["id"] = id.to_s if id
+ root.root << cs
+ root
+ end
end
end