From e91956d0f7ea6f2b0719a1459110ad3a09d2ee9a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 15 Nov 2013 15:36:54 -0800 Subject: [PATCH] Fix test failures --- app/controllers/changeset_controller.rb | 49 ++--- app/helpers/title_helper.rb | 7 +- app/views/browse/_node.html.erb | 12 +- app/views/browse/_relation.html.erb | 12 +- app/views/browse/_way.html.erb | 12 +- app/views/layouts/_head.html.erb | 2 +- config/locales/ast.yml | 1 - config/locales/be-Tarask.yml | 1 - config/locales/bs.yml | 1 - config/locales/cs.yml | 1 - config/locales/da.yml | 1 - config/locales/de.yml | 1 - config/locales/el.yml | 1 - config/locales/es.yml | 1 - config/locales/et.yml | 1 - config/locales/fi.yml | 1 - config/locales/fur.yml | 1 - config/locales/gl.yml | 1 - config/locales/he.yml | 1 - config/locales/hu.yml | 1 - config/locales/ia.yml | 1 - config/locales/id.yml | 1 - config/locales/it.yml | 1 - config/locales/ja.yml | 1 - config/locales/ko.yml | 1 - config/locales/lt.yml | 1 - config/locales/lv.yml | 1 - config/locales/mk.yml | 1 - config/locales/ms.yml | 1 - config/locales/nb.yml | 1 - config/locales/nl.yml | 1 - config/locales/nn.yml | 1 - config/locales/pl.yml | 1 - config/locales/pt-BR.yml | 1 - config/locales/pt.yml | 1 - config/locales/ro.yml | 1 - config/locales/ru.yml | 1 - config/locales/sk.yml | 1 - config/locales/sl.yml | 1 - config/locales/sr-Latn.yml | 1 - config/locales/sr.yml | 1 - config/locales/sv.yml | 1 - config/locales/tl.yml | 1 - config/locales/uk.yml | 1 - config/locales/vi.yml | 1 - config/locales/zh-CN.yml | 1 - test/functional/browse_controller_test.rb | 53 ++--- test/functional/changeset_controller_test.rb | 38 ++-- .../functional/diary_entry_controller_test.rb | 205 +++++++----------- test/functional/geocoder_controller_test.rb | 2 +- test/functional/message_controller_test.rb | 2 +- test/functional/site_controller_test.rb | 11 +- .../functional/user_blocks_controller_test.rb | 12 +- test/functional/user_controller_test.rb | 26 +-- test/functional/user_roles_controller_test.rb | 4 +- test/integration/client_application_test.rb | 19 +- test/integration/user_diaries_test.rb | 20 +- test/integration/user_login_test.rb | 68 +++--- 58 files changed, 231 insertions(+), 363 deletions(-) diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index bd908879f..6a0ad40a7 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -252,42 +252,41 @@ class ChangesetController < ApplicationController def list if request.format == :atom and params[:page] redirect_to params.merge({ :page => nil }), :status => :moved_permanently - elsif request.format == :html and !params[:bbox] + return + end + + if params[:display_name] + user = User.find_by_display_name(params[:display_name]) + if !user || !user.active? + render_unknown_user params[:display_name] + return + end + end + + if (params[:friends] || params[:nearby]) && !@user && request.format == :html + require_user + return + end + + if request.format == :html and !params[:bbox] render :action => :history, :layout => map_layout else changesets = conditions_nonempty(Changeset.all) if params[:display_name] - user = User.find_by_display_name(params[:display_name]) - - if user and user.active? - if user.data_public? or user == @user - changesets = changesets.where(:user_id => user.id) - else - changesets = changesets.where("false") - end + if user.data_public? or user == @user + changesets = changesets.where(:user_id => user.id) else - render_unknown_user params[:display_name] - return + changesets = changesets.where("false") end end - if params[:friends] - if @user - changesets = changesets.where(:user_id => @user.friend_users.public) - elsif request.format == :html - require_user - return - end + if params[:friends] && @user + changesets = changesets.where(:user_id => @user.friend_users.public) end - if params[:nearby] - if @user - changesets = changesets.where(:user_id => @user.nearby) - elsif request.format == :html - require_user - return - end + if params[:nearby] && @user + changesets = changesets.where(:user_id => @user.nearby) end if params[:bbox] diff --git a/app/helpers/title_helper.rb b/app/helpers/title_helper.rb index c9b979ad5..da4ad8967 100644 --- a/app/helpers/title_helper.rb +++ b/app/helpers/title_helper.rb @@ -1,11 +1,6 @@ module TitleHelper def set_title(title = false) - if title - title = t('layouts.project_name.title') + ' | ' + title - else - title = t('layouts.project_name.title') - end - response.headers["X-Page-Title"] = title + response.headers["X-Page-Title"] = t('layouts.project_name.title') + (title ? ' | ' + title : '') @title = title end end diff --git a/app/views/browse/_node.html.erb b/app/views/browse/_node.html.erb index 5b29865db..2c2cdd4c0 100644 --- a/app/views/browse/_node.html.erb +++ b/app/views/browse/_node.html.erb @@ -1,11 +1,13 @@ -
- <% if node.redacted? %> +<% if node.redacted? %> +
<%= t 'browse.redacted.message_html', :type => t('browse.redacted.type.node'), :version => node.version, :redaction_link => link_to(t('browse.redacted.redaction', :id => node.redaction.id), node.redaction) %> - <% else %> +
+<% else %> +
<%= render :partial => "common_details", :object => node %> <% unless node.ways.empty? and node.containing_relation_members.empty? %> @@ -17,5 +19,5 @@ <%= render :partial => "containing_relation", :collection => node.containing_relation_members %> <% end %> - <% end %> -
+
+<% end %> diff --git a/app/views/browse/_relation.html.erb b/app/views/browse/_relation.html.erb index e8f9a4f51..6befb8aae 100644 --- a/app/views/browse/_relation.html.erb +++ b/app/views/browse/_relation.html.erb @@ -1,11 +1,13 @@ -
- <% if relation.redacted? %> +<% if relation.redacted? %> +
<%= t 'browse.redacted.message_html', :type => t('browse.redacted.type.relation'), :version => relation.version, :redaction_link => link_to(t('browse.redacted.redaction', :id => relation.redaction.id), relation.redaction) %>< - <% else %> +
+<% else %> +
<%= render :partial => "common_details", :object => relation %> <% unless relation.relation_members.empty? %> @@ -17,5 +19,5 @@

<%= t'browse.part_of' %>

    <%= render :partial => "containing_relation", :collection => relation.containing_relation_members %>
<% end %> - <% end %> -
+
+<% end %> diff --git a/app/views/browse/_way.html.erb b/app/views/browse/_way.html.erb index 9156d2399..fd419586f 100644 --- a/app/views/browse/_way.html.erb +++ b/app/views/browse/_way.html.erb @@ -1,11 +1,13 @@ -
- <% if way.redacted? %> +<% if way.redacted? %> +
<%= t 'browse.redacted.message_html', :type => t('browse.redacted.type.way'), :version => way.version, :redaction_link => link_to(t('browse.redacted.redaction', :id => way.redaction.id), way.redaction) %> - <% else %> +
+<% else %> +
<%= render :partial => "common_details", :object => way %> <% unless way.way_nodes.empty? %> @@ -29,5 +31,5 @@ <%= render :partial => "containing_relation", :collection => way.containing_relation_members %> <% end %> - <% end %> -
+
+<% end %> diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb index 1897cfff3..9e603abab 100644 --- a/app/views/layouts/_head.html.erb +++ b/app/views/layouts/_head.html.erb @@ -45,5 +45,5 @@ OSM.oauth_consumer_secret = "<%= @oauth.client_application.secret %>"; <% end -%> - <%= @title %> + <%= t 'layouts.project_name.title' %><%= ' | ' + @title if @title %> diff --git a/config/locales/ast.yml b/config/locales/ast.yml index 0e1258d33..87a4f0c48 100644 --- a/config/locales/ast.yml +++ b/config/locales/ast.yml @@ -216,7 +216,6 @@ ast: hide_areas: Anubrir árees history_for_feature: Historial de %{feature} load_data: Cargar datos - loaded_an_area_with_num_features: "Cargasti un área que contién %{num_features} carauterístiques. Polo xeneral, dellos restoladores nun pueden amosar bien esta cantidá de datos. Normalmente los restoladores funcionen meyor amosando menos de %{max_features} carauterístiques al tiempu: d'otra miente se tornen lentos/dexen de responder. Si tas seguru d'amosar los datos, pues facelo calcando nel botón d'abaxo." loading: Cargando... manually_select: Seleiciona manualmente un área distinta notes_layer_name: Navegar notes diff --git a/config/locales/be-Tarask.yml b/config/locales/be-Tarask.yml index 7f74340c9..7bc49e4ff 100644 --- a/config/locales/be-Tarask.yml +++ b/config/locales/be-Tarask.yml @@ -209,7 +209,6 @@ be-Tarask: hide_areas: Схаваць вобласьці history_for_feature: Гісторыя %{feature} load_data: Загрузіць зьвесткі - loaded_an_area_with_num_features: Вы загрузілі мясцовасьць, якая ўтрымлівае %{num_features} аб’ектаў. Увогуле, некаторыя браўзэры ня змогуць апрацаваць такую колькасьць зьвестак. Звычайна найлепшы вынік назіраецца, калі аб’ектаў менш за %{max_features}, пры выкананьні яшчэ нейкіх задачаў браўзэр можа страціць хуткасьць/завіснуць. Калі Вы ўпэўненыя, што жадаеце паказаць гэтыя зьвесткі, націсьніце кнопку ніжэй. loading: Загрузка… manually_select: Выбраць іншы абшар notes_layer_name: Прагляд нататак diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 7066d1a90..8bb89b644 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -207,7 +207,6 @@ bs: hide_areas: Sakriti područja history_for_feature: Historija za %{feature} load_data: Učitati podatke - loaded_an_area_with_num_features: "Učitali ste područje koje sadrži %{num_features} značajki. Općenito, neki se web preglednici ne mogu nositi sa prikazom tolike količine podataka. Inače, preglednici najbolje rade kada prikazuju manje od %{max_features} značajki istovremeno: ukoliko radite još nešto, to može usporiti preglednik ili ga zalediti. Ako ste sigurni da želite prikazati ove podtake, možete to učiniti klikom na dugme ispod." loading: Učitavanje... manually_select: Ručno izabrati drukčije područje object_list: diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 15320f3e9..886ff1c83 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -233,7 +233,6 @@ cs: hide_areas: Schovat oblasti history_for_feature: Historie pro %{feature} load_data: Nahrát data - loaded_an_area_with_num_features: Máte načtenu oblast, která obsahuje %{num_features} prvků. Některé prohlížeče mohou mít potíže při zobrazování takového množství dat. Obecně fungují prohlížeče nejlépe při zobrazování ne více než %{max_features} prvků současně – větší množství může způsobit, že bude prohlížeč reagovat pomalu či vůbec. Pokud jste si jisti, že chcete tato data zobrazit, klikněte na tlačítko níže. loading: Načítá se… manually_select: Ručně vybrat jinou oblast notes_layer_name: Procházet poznámky diff --git a/config/locales/da.yml b/config/locales/da.yml index f74e01080..1bf66fffc 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -231,7 +231,6 @@ da: hide_areas: Skjul områder history_for_feature: Historik for %{feature} load_data: Indlæs data - loaded_an_area_with_num_features: "Du har indlæst et område som indeholder %{num_features} objekter. Nogle browsere kan have problemer ved håndtering af så meget data. Browsere fungerer generelt bedst med mindre end %{max_features} objekter ad gangen: flere objekter kan gøre at din browser bliver langsom. Hvis du er sikker på, at du vil se alle disse data, så klik på knappen nedenfor." loading: Indlæser... manually_select: Vælg et andet område manuelt notes_layer_name: Gennemse bemærkninger diff --git a/config/locales/de.yml b/config/locales/de.yml index 5e0662e9f..9bfdd9465 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -246,7 +246,6 @@ de: hide_areas: Flächen ausblenden history_for_feature: Chronik für %{feature} load_data: Daten laden - loaded_an_area_with_num_features: Du hast einen Bereich ausgewählt, der %{num_features} Elemente enthält. Manche Browser werden bei der Verarbeitung einer so großen Datenmenge langsam oder frieren ein (reagieren nicht mehr auf Eingaben). Üblicherweise sollten weniger als %{max_features} Elemente angezeigt werden. Falls du dir sicher bist, dass so viele Elemente laden möchtest, klicke unten auf „Daten laden“. loading: Lade … manually_select: Einen anderen Kartenausschnitt manuell auswählen notes_layer_name: Alle Hinweise anzeigen diff --git a/config/locales/el.yml b/config/locales/el.yml index 845de71f3..503fdfad7 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -234,7 +234,6 @@ el: hide_areas: Απόκρυψη περιοχών history_for_feature: Ιστορικό για %{feature} load_data: Φόρτωση δεδομένων - loaded_an_area_with_num_features: "Έχετε φορτώσει μια περιοχή που περιέχει %{num_features} χαρακτηριστικά. Γενικά, μερικοί browsers μπορεί να μην αντέχουν να δείξουν τόσα πολλά στοιχεία. Γενικά, οι browsers δουλεύουν καλύτερα δείχνοντας λιγότερα από %{max_features} χαρακτηριστικά τη φορά: με οτιδήποτε άλλο ο browser μπορεί να γίνει αργός ή να μην αντιδρά. Αν είστε σίγουρος ότι θέλετε να δείτε αυτά τα δεδομένα, κάντε κλικ στο παρακάτω κουμπί." loading: Φόρτωση σε εξέλιξη... manually_select: Χειροκίνητη επιλογή διαφορετικής περιοχής notes_layer_name: Περιήγηση Σημειώσεων diff --git a/config/locales/es.yml b/config/locales/es.yml index f801aa209..17223fdbd 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -240,7 +240,6 @@ es: hide_areas: Ocultar áreas history_for_feature: Historial de %{feature} load_data: Cargar datos - loaded_an_area_with_num_features: Has cargado un área que contiene %{num_features} objetos. Por lo general, algunos navegadores de internet no aguantan bien el mostrar esta cantidad de información vectorial. Generalmente, el funcionamiento óptimo se da cuando se muestran menos de %{max_features} objetos al mismo tiempo; de otra manera, tu navegador puede volverse lento o no responder. Si estás seguro de que quieres mostrar todos estos datos, puedes hacerlo pulsando el botón que aparece debajo. loading: Cargando... manually_select: Seleccionar manualmente un área diferente notes_layer_name: Ver notas diff --git a/config/locales/et.yml b/config/locales/et.yml index f6d045da7..8cffe3cbc 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -200,7 +200,6 @@ et: hide_areas: Peida alad history_for_feature: Omaduse %{feature} ajalugu load_data: Laadi andmed - loaded_an_area_with_num_features: Oled laadinud ala, mis sisaldab %{num_features} objekti. Mõned brauserid ei saa hästi hakkama sellise hulga andmete kuvamisega. Üldiselt suudavad brauserid kuvada korraga kuni %{max_features} objekti. Suurema arvu laadimine võib muuta brauseri aeglaseks või see lakkab üldse toimimast. Kui soovid siiski neid andmeid kuvada, võid seda teha, klõpsates nupul allpool. loading: Laadin andmeid... manually_select: Vali uus ala notes_layer_name: Sirvi märkuseid diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 43f0a94d2..1393ed1e4 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -232,7 +232,6 @@ fi: hide_areas: Piilota alueet history_for_feature: Ominaisuuden %{feature} historia load_data: Lataa tiedot - loaded_an_area_with_num_features: Olet ladannut alueen, joka sisältää %{num_features} osiota. Yleensä jotkin selaimet eivät kykene näyttämään tätä määrää dataa. Yleisesti selaimet toimivat parhaiten näyttäessään alle %{max_features} kohdetta kerrallaan. Muussa tapauksessa selain saattaa tulla hitaaksi tai lakata toimimasta kokonaan. Jos olet varma että haluat näyttää tämän datan, voit tehdä niin napsauttamalla alla olevaa painiketta. loading: Ladataan tietoja... manually_select: Rajaa pienempi alue käsin notes_layer_name: Näytä karttailmoitukset diff --git a/config/locales/fur.yml b/config/locales/fur.yml index 68aae0288..ac96a0cd2 100644 --- a/config/locales/fur.yml +++ b/config/locales/fur.yml @@ -197,7 +197,6 @@ fur: hide_areas: Plate areis history_for_feature: Storic par %{feature} load_data: Cjame i dâts - loaded_an_area_with_num_features: "Tu âs cjamât une aree che e conten %{num_features} carataristichis. In gjenerâl, cualchi sgarfadôr al podarès no rivâ a gjestî ben cheste cuantitât di dâts. I sgarfadôrs par solit a lavorin miôr se a mostrin mancul di %{max_features} carataristichis ae volte: cualsisei altri numar al podarès ralentâ/no fâ plui rispuindi il sgarfadôr. Se tu sês sigûr di volê mostrâ chescj dâts, frache sul boton ca sot." loading: Daûr a cjamâ... manually_select: Sielç a man une aree divierse notes_layer_name: Mostre lis notis diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 4acac9465..f23573cc0 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -219,7 +219,6 @@ gl: hide_areas: Agochar as zonas history_for_feature: Historial de %{feature} load_data: Cargar os datos - loaded_an_area_with_num_features: Cargou unha zona que contén %{num_features} funcionalidades. Pode que algúns navegadores teñan problemas para mostrar correctamente esta cantidade de datos. Xeralmente, os navegadores traballan mellor mostrando menos de %{max_features} funcionalidades á vez. Utilizar máis pode provocar que o navegador vaia lento ou non responda. Se está seguro de que quere mostrar estes datos, pode facelo premendo no seguinte botón. loading: Cargando... manually_select: Escoller manualmente unha zona distinta notes_layer_name: Explorar as notas diff --git a/config/locales/he.yml b/config/locales/he.yml index ffd714298..4cadc97ae 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -229,7 +229,6 @@ he: hide_areas: להסתרת אזורים history_for_feature: ההיסטוריה של %{feature} load_data: טעינת נתונים - loaded_an_area_with_num_features: "האזור שנטען מכיל %{num_features} תכונות. באופן כללי, חלק מהדפדפנים לא יוכלו להתמודד עם הצגה של כזו כמות של נתונים. לרוב, דפדפנים עובדים באופן מיטבי בהצגת פחות מ־%{max_features} תכונות בו־זמנית: ביצוע משימות נוספות עלול לגרום לדפדפן לפעול באופן איטי או להיתקע. אם ברצונך בכל זאת להציג מידע זה, באפשרותך להציג אותו בלחיצה על הכפתור למטה." loading: בטעינה... manually_select: בחירת אזור אחר ידנית notes_layer_name: עיון בהערות diff --git a/config/locales/hu.yml b/config/locales/hu.yml index e9cd5e40f..a146d201f 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -227,7 +227,6 @@ hu: hide_areas: Területek elrejtése history_for_feature: "%{feature} előzményei" load_data: Adatok betöltése - loaded_an_area_with_num_features: "Olyan területet töltöttél be, amely %{num_features} elemet tartalmaz. Néhány böngésző lehet, hogy nem birkózik meg ekkora mennyiségű adattal. Általában a böngészők egyszerre legfeljebb %{max_features} elemet tudnak megjeleníteni: minden más esetben a böngésző lelassulhat/nem válaszolhat. Ha biztos vagy benne, hogy meg szeretnéd jeleníteni ezeket az adatokat, megteheted ezt az alábbi gombra kattintva." loading: Betöltés… manually_select: Más terület kézi kijelölése notes_layer_name: Jegyzetek böngészése diff --git a/config/locales/ia.yml b/config/locales/ia.yml index cf37b41f9..80f0ecf86 100644 --- a/config/locales/ia.yml +++ b/config/locales/ia.yml @@ -217,7 +217,6 @@ ia: hide_areas: Celar areas history_for_feature: Historia de %{feature} load_data: Cargar datos - loaded_an_area_with_num_features: Tu ha cargate un area que contine %{num_features} elementos. In general, alcun navigatores del web pote haber problemas in presentar un tal quantitate de datos. Generalmente, un navigator functiona melio monstrante minus de %{max_features} elementos per vice; alteremente, illo pote devenir lente o non responder. Si tu es secur de voler visualisar iste datos, tu pote cliccar super le button a basso. loading: Cargamento... manually_select: Seliger manualmente un altere area notes_layer_name: Percurrer notas diff --git a/config/locales/id.yml b/config/locales/id.yml index 29e0f7c96..69ff09e89 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -224,7 +224,6 @@ id: hide_areas: Sembunyikan wilayah history_for_feature: Riwayat untuk %{feature} load_data: Memuat Data - loaded_an_area_with_num_features: "Anda telah memuat wilayah yang berisi %{num_features} fitur. Secara umum, beberapa browser mungkin tidak dapat mengatasi dengan baik untuk menampilkan sejumlah data tersebut, browser akan bekerja dengan baik dalam menampilkan data kurang dari %{max_features} fitur pada saat yang sama: lebih daripada itu akan membuat browser anda menjadi lamban/tidak responsif. Jika anda yakin ingin menampilkan data ini, anda dapat melakukannya dengan mengklik tombol di bawah." loading: Memuat... manually_select: Pilih wilayah berbeda secara manual notes_layer_name: Lihat Catatan diff --git a/config/locales/it.yml b/config/locales/it.yml index 83eafa9f1..0e4d7d3fe 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -234,7 +234,6 @@ it: hide_areas: Nascondi le aree history_for_feature: Cronologia per %{feature} load_data: Carica dati - loaded_an_area_with_num_features: "È stata caricata un'area che contiene %{num_features} caratteristiche. In generale, alcuni browser potrebbero non visualizzare correttamente questa quantità di dati. Generalmente i browser lavorano al meglio se si visualizzano meno di %{max_features} caratteristiche alla volta: se si fa qualcos'altro il proprio browser potrebbe diventare lento o non rispondere più. Se si è sicuri di voler visualizzare questi dati, allora si può premere il pulsante sottostante." loading: Caricamento in corso... manually_select: Seleziona manualmente un'area differente notes_layer_name: Mostra le note diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 9a685238d..7d579ab58 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -227,7 +227,6 @@ ja: hide_areas: 領域を隠す history_for_feature: "%{feature}の履歴" load_data: データの読み込み - loaded_an_area_with_num_features: "%{num_features}件の地物を含む領域を読み込みました。一般に、ブラウザーによっては、この量のデータを表示するとうまく処理できないかもしれません。通常、ブラウザーは一度に%{max_features}件未満の地物を表示させるとうまく動作します。このままでは、ブラウザーが遅くなったり、反応しなくなったりします。それでもこのデータを表示したいならば、以下のボタンをクリックしてください。" loading: 読み込み中... manually_select: ドラッグして別の領域を選択 notes_layer_name: メモを閲覧 diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 27327ff57..49451a4c0 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -216,7 +216,6 @@ ko: hide_areas: 지역 숨기기 history_for_feature: "%{feature}의 역사" load_data: 데이터 불러오기 - loaded_an_area_with_num_features: 당신은 특성을 가진 지역 %{num_features}개를 불러왔습니다. 일반적으로, 일부 브라우저에서는 이 데이터 개수를 모두 처리하지 못할 수도 있습니다. 일반적으로, 브라우저들은 대개 특성 %{max_features}개 이하를 처리하여 보여줄 수 있습니다. 그렇지 않은 경우, 브라우저의 속도가 저하되거나 브라우저의 반응이 느려질 수 있습니다. 여전히 이 데이터를 표시하려면, 아래의 버튼을 클릭하세요. loading: 불러오는 중... manually_select: 다른 지역 선택 notes_layer_name: 참고 찾아보기 diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 8541e82be..3108aaf60 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -223,7 +223,6 @@ lt: hide_areas: Slėpti sritis history_for_feature: Istorija apie %{feature} load_data: Kraunami duomenys - loaded_an_area_with_num_features: Jūs įkėlėte sritį, kurioje yra %{num_features} elementų. Dažniausiai naršyklės nelabai gerai susitvarko su tokiu duomenų kiekiu. Paprastai naršyklės kur kas geriau susidoroja, kai elementų yra mažiau nei %{max_features} vienu metu. Bet kokie kiti veiksmai gali stipriai sulėtinti naršyklę. Jei tikrai norite žiūrėti šiuos duomenis, spauskite žemiau esantį mygtuką. loading: Kraunama... manually_select: Rankiniu būdu pažymėkite kitą teritoriją notes_layer_name: Peržiūrėti pastabas diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 3ff4a9f5f..46305d31d 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -225,7 +225,6 @@ lv: hide_areas: Paslēpt zonas history_for_feature: Vēsture %{feature} load_data: Ielādēt datus - loaded_an_area_with_num_features: "Jūs esat ielādējis apgabalu, kurš satur %{num_features} iezīmes. Pamatā, daži pārlūki var pārāk labi netikt galā ar šādu lielu datu kvantuma parādīšanu. Parasti, pārlūki tiek galā vislabāk rādot mazāk nekā %{max_features} iezīmes vienlaikus: jebkā cita darīšana tos bremzē. Ja Jūs esat drošs, ka vēlaties attēlot šos datus, Jūs tā varat izdarīt spiežot pogu zemāk." loading: Ielādē… manually_select: Manuāli izvēlēties citu apgabalu notes_layer_name: Pārlūkot Piezīmes diff --git a/config/locales/mk.yml b/config/locales/mk.yml index c188b58b8..24cc0084c 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -217,7 +217,6 @@ mk: hide_areas: Скриј подрачја history_for_feature: Историја за %{feature} load_data: Вчитај ги податоците - loaded_an_area_with_num_features: "Вчитавте простор што содржи %{num_features} елементи. Некои прелистувачи не можат да се справат со толку податоци. Начелно, прелистувачите работат најдобро при помалку од %{max_features} елементи наеднаш: ако правите нешто друго прелистувачот ќе ви биде бавен/пасивен. Ако и покрај тоа сакате да се прикажат овие податоци, тогаш стиснете на копчето подолу." loading: Вчитувам... manually_select: Рачно изберете друга површина notes_layer_name: Прелистај белешки diff --git a/config/locales/ms.yml b/config/locales/ms.yml index aad0a7de3..e62fe5610 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -211,7 +211,6 @@ ms: hide_areas: Sorokkan kawasan history_for_feature: Sejarah %{feature} load_data: Muatkan Data - loaded_an_area_with_num_features: Anda telah memilih satu kawasan yang mengandungi %{num_features} ciri. Pada umumnya, sesetengah pelayar web tidak mungkin mampu memaparkan sebegini banyak data dengan betul. Lazimnya, pelayar paling berkemampuan apabila memaparkan kurang daripada %{max_features} ciri sekaligus; lebih daripada itu mungkin akan melambatkan pelayar anda atau membuatnya tidak responsif. Jika anda betul-betul ingin memaparkan data ini, anda boleh berbuat demikian dengan mengklik butang di bawah. loading: Memuatkan... manually_select: Pilih kawasan yang lain secara insani notes_layer_name: Semak Imbas Nota diff --git a/config/locales/nb.yml b/config/locales/nb.yml index 4c596ec2e..13dc00183 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -228,7 +228,6 @@ nb: hide_areas: Skjul områder history_for_feature: Historikk for %{feature} load_data: Last inn data - loaded_an_area_with_num_features: "Du har lastet et område som inneholder %{num_features} objekter. Noen nettlesere kan få problemer med å håndtere så mye data. Generelt fungerer nettlesere best med mindre enn %{max_features} objekter av gangen: flere objekter kan føre til at nettleseren din blir treg eller fryser helt. Om du er sikker på at du vil se denne informasjonen, kan du gjøre det ved å klikke på knappen under." loading: Laster... manually_select: Velg et annet område manuelt notes_layer_name: Se på merknader diff --git a/config/locales/nl.yml b/config/locales/nl.yml index c2cdc7642..af983e78b 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -227,7 +227,6 @@ nl: hide_areas: Gebieden verbergen history_for_feature: Geschiedenis voor %{feature} load_data: Gegevens laden - loaded_an_area_with_num_features: U hebt een gebied geladen dat %{num_features} objecten bevat. Sommige browsers kunnen niet goed overweg met zoveel gegevens. Normaal gesproken werken browsers het best met minder dan %{max_features} objecten. Als u er meer weergeeft kan de browser traag worden of niet meer reageren. Als u zeker weet dat u de gegevens wilt weergeven, klik dan op de knop hieronder. loading: Bezig met laden… manually_select: Handmatig een ander gebied selecteren notes_layer_name: Opmerkingen bekijken diff --git a/config/locales/nn.yml b/config/locales/nn.yml index d4f7b4f80..db435a4e5 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -231,7 +231,6 @@ nn: hide_areas: Skjul områder history_for_feature: Historikk for %{feature} load_data: Last inn data - loaded_an_area_with_num_features: Dette området inneheld %{num_features} objekt. Nokre nettlesarar kan ikkje handtere så mykje data. For å ikkje risikere at nettlesaren låsar seg bør du halde deg til under %{max_features} objekt. Om du er sikker på at du vil sjå informasjonen kan du klikke på knappen nedanfor. loading: Lastar... manually_select: Vel eit anna område manuelt notes_layer_name: Bla gjennom notiser diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 3fa8f1c7c..8997c6383 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -240,7 +240,6 @@ pl: hide_areas: Ukryj obszary history_for_feature: Historia zmian dla %{feature} load_data: Wczytaj dane - loaded_an_area_with_num_features: Wczytano obszar zawierający %{num_features} obiektów. Niektóre przeglądarki internetowe mogą nie radzić sobie z wyświetleniem tej ilości danych. Na ogół przeglądarki działają najlepiej przy wyświetlaniu mniej niż %{max_features} obiektów jednocześnie, w przeciwnym przypadku przeglądarka może działać powoli lub przestać odpowiadać. Jeśli jesteś pewien, że chcesz wyświetlić dane, kliknij przycisk poniżej. loading: Wczytywanie... manually_select: Ręcznie zaznacz inny obszar notes_layer_name: Przeglądaj uwagi diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index f6fddbcd8..4aed31772 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -239,7 +239,6 @@ pt-BR: hide_areas: Ocultar áreas history_for_feature: Histórico para %{feature} load_data: Carregar dados - loaded_an_area_with_num_features: "Você carregou uma área que contém %{num_features} pontos. Alguns navegadores podem não conseguir exibir essa quantidade de dados. Geralmente, navegadores trabalham melhor exibindo menos de %{max_features} pontos por vez: acima disso pode deixá-lo lento ou travá-lo. Se você tem certeza que deseja exibir estes dados, clique no botão abaixo." loading: Carregando... manually_select: Selecionar manualmente uma área diferente notes_layer_name: Ver Notas diff --git a/config/locales/pt.yml b/config/locales/pt.yml index b108a9877..663cd84b5 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -232,7 +232,6 @@ pt: hide_areas: Ocultar áreas history_for_feature: Histórico de %{feature} load_data: Carregar Dados - loaded_an_area_with_num_features: Carregou uma área com %{num_features} elementos. Alguns navegadores de Internet podem ter problemas em mostrar esta quantidade de dados. Geralmente os navegadores funcionam melhor a mostrar até %{max_features} elementos de cada vez. Mais do que isso o navegador poderá ficar muito lento ou até bloquear. Se tem a certeza que quer mostrar esta quantidade de elementos clique no botão seguinte. loading: A carregar… manually_select: Selecionar manualmente uma área diferente notes_layer_name: Ver Erros Reportados diff --git a/config/locales/ro.yml b/config/locales/ro.yml index ea5c2bab8..18982757b 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -195,7 +195,6 @@ ro: hide_areas: Ascunde suprafețele history_for_feature: Istoric pentru %{feature} load_data: Încărcare date - loaded_an_area_with_num_features: "Ați încărcat o zonă care conține %{num_features} elemente. În general, unele navigatoare nu sunt capabile să facă față afișării unei asemenea cantități de date. Navigatoarele funcționează cel mai bine atunci când afișează mai puțin de %{max_features} elemente simultan: dacă mai faceți și alte operații cu navigatorul dumneavoastră în paralel veți observa o încetinire / lipsă de răspuns din partea navigatorului. Dacă doriți să afișați aceste date apăsați butonul de mai jos." loading: Se încarcă... manually_select: Selectare manuală a unei alte zone object_list: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 876a40bfc..189c2c056 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -251,7 +251,6 @@ ru: hide_areas: Скрыть области history_for_feature: История %{feature} load_data: Загрузить данные - loaded_an_area_with_num_features: Вы загрузили область, которая содержит %{num_features} объектов. Некоторые браузеры могут не справиться с отображением такого количества данных. Обычно браузеры могут обрабатывать до %{max_features} объектов. Загрузка большего числа может замедлить ваш браузер или привести к его зависанию. Если вы всё равно хотите отобразить эти данные, нажмите на кнопку ниже. loading: Загрузка... manually_select: Выделить другую область notes_layer_name: Просмотр заметок diff --git a/config/locales/sk.yml b/config/locales/sk.yml index d98e5627c..559652112 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -226,7 +226,6 @@ sk: hide_areas: Skryť oblasti history_for_feature: História pre %{feature} load_data: Načítať údaje - loaded_an_area_with_num_features: Máte načítanú oblasť, ktorá obsahuje %{num_features} zložiek. Niektoré prehliadače môžu mať problémy so zobrazením takého množstva dát, viac než približne %{max_features} položiek ich môže spomaliť až zablokovať. Pokiaľ ste si istý, že chcete dáta zobraziť, kliknite na tlačítko nižšie. loading: Nahrávanie... manually_select: Manuálne vybrať inú oblasť notes_layer_name: Zobraziť všetky chyby diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 7fe24a9b3..e897cb3bf 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -225,7 +225,6 @@ sl: hide_areas: Skrij področja history_for_feature: Zgodovina %{feature} load_data: Naloži podatke - loaded_an_area_with_num_features: "Naložili ste področje, ki vsebuje %{num_features} elementov. Nekateri spletni brskalniki ne zmorejo prikaza takšne količine podatkov. Na splošno brskalniki najbolje prikazujejo %{max_features} ali manj elementov hkrati: karkoli drugega lahko upočasni vaš brskalnik ali ga naredi neodzivnega. Če ste prepričani, da želite prikazati vse te podatke, pritisnite na spodnji gumb." loading: Nalaganje ... manually_select: Ročno izberite drugo področje notes_layer_name: Brskanje opomb diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index 93e018d24..f9a29d780 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -215,7 +215,6 @@ sr-Latn: hide_areas: Sakrij područja history_for_feature: Istorija za %{feature} load_data: Učitaj podatke - loaded_an_area_with_num_features: "Učitali ste područje koje sadrži %{num_features} mogućnosti. Neki pregledači se ne mogu nositi s tolikom količinom podataka. Oni najbolje rade kada prikazuju manje od %{max_features} mogućnosti istovremeno: ako radite još nešto, to može usporiti pregledač ili ga zakočiti. Ako ste sigurni da želite da prikažete ove podatke, možete to uraditi klikom na dugme ispod." loading: Učitavam… manually_select: Ručno izaberite drugo područje object_list: diff --git a/config/locales/sr.yml b/config/locales/sr.yml index db5b8a2d4..8f8c5ee25 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -230,7 +230,6 @@ sr: hide_areas: Сакриј подручја history_for_feature: Историја за %{feature} load_data: Учитај податке - loaded_an_area_with_num_features: "Учитали сте подручје које садржи %{num_features} могућности. Неки прегледачи се не могу носити с толиком количином података. Они најбоље раде када приказују мање од %{max_features} могућности истовремено: ако радите још нешто, то може успорити прегледач или га закочити. Ако сте сигурни да желите да прикажете ове податке, можете то урадити кликом на дугме испод." loading: Учитавам… manually_select: Ручно изаберите друго подручје object_list: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index ba874d1da..3b1cb6f74 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -242,7 +242,6 @@ sv: hide_areas: Göm område history_for_feature: Historik för %{feature} load_data: Ladda data - loaded_an_area_with_num_features: "Du har läst in ett område som innehåller %{num_features} objekt. En del webbläsare klarar inte av hantering av sådana stora mängder data. Vanligtvis arbetar webbläsare bäst när de visar mindre än %{max_features} objekt samtidigt: att göra någonting annat kan få din webbläsare att bli långsam eller sluta att svara. Om du är säker på att du vill visa denna data kan du göra det genom att klicka på knappen nedan." loading: Läser in... manually_select: Välj ett annan område manuellt notes_layer_name: Bläddra bland anteckningar diff --git a/config/locales/tl.yml b/config/locales/tl.yml index b0edff09c..202b21e43 100644 --- a/config/locales/tl.yml +++ b/config/locales/tl.yml @@ -211,7 +211,6 @@ tl: hide_areas: Itago ang mga lugar history_for_feature: Kasaysayan para sa %{feature} load_data: Ikarga ang Dato - loaded_an_area_with_num_features: "Nagkarga ka ng isang pook na naglalaman ng %{num_features} na mga tampok. Sa pangkalahatan, ilang mga pantingin-tingin ang hindi maaaring makaangkop ng mabuti sa pagpapakita ng ganitong dami ng dato. Sa pangkalahatan, gumagana ng pinakamahusay ang mga pantingin-tingin kapag nagpapakita ng mas kakaunti kaysa %{max_features} na mga tampok: ang paggawa ng ibang mga bagay ay maaaring makagawa sa iyong pantingin-tingin upang bumagal/hindi tumutugon. Kung nakatitiyak kang nais mong ipakita ang ganitong dato, magagawa mo ito sa pamamagitan ng pagpindot sa pindutang nasa ibaba." loading: Ikinakarga... manually_select: Kinakamay na pumili ng iba pang lugar object_list: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 277cad201..f1bae23a0 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -236,7 +236,6 @@ uk: hide_areas: Приховати ділянки history_for_feature: Історія %{feature} load_data: Завантажити Дані - loaded_an_area_with_num_features: "Ви завантажили ділянку, яка містить %{num_features} об’єктів. Загалом, деякі оглядачі можуть не впоратися з відображенням такої кількості даних. Зазвичай, оглядачі працюють краще, коли водночас показується не більше %{max_features} об'єктів: якщо ж ви робите інакше, це може спричинити сповільнення чи взагалі відсутність відгуку у вашому оглядачі. Коли ви впевнені, що слід показати ці дані, можете натиснути кнопку нижче." loading: Завантаження… manually_select: Виберіть іншу ділянку notes_layer_name: Огляд нотаток diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 547b56115..86e59e341 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -219,7 +219,6 @@ vi: hide_areas: Ẩn các khu vực history_for_feature: Lịch sử %{feature} load_data: Tải Dữ liệu - loaded_an_area_with_num_features: Bạn đã tải vùng chứa %{num_features} đối tượng. Một số trình duyệt bị trục trặc khi hiển thị nhiều dữ liệu như thế. Nói chung, các trình duyệt hoạt động tốt với tối đa %{max_features} đối tượng cùng lúc; nếu hơn thì trình duyệt sẽ chậm chạp. Nếu bạn chắc chắn muốn xem dữ liệu này, hãy bấm nút ở dưới. loading: Đang tải… manually_select: Chọn vùng khác thủ công notes_layer_name: Xem các Ghi chú diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 929b0044d..02604f842 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -238,7 +238,6 @@ zh-CN: hide_areas: 隐藏区域 history_for_feature: "%{feature}的历史" load_data: 载入数据 - loaded_an_area_with_num_features: 你已经载入一个包含%{num_features}个特征的区域。一般而言,一些浏览器无法正常显示这一数量的数据。通常,浏览器可以较好地显示少于%{max_features}个特征,超过这一数量则会使你的浏览器变慢/无响应。如果你确定你想要显示这些数据,请单击下面的按钮。 loading: 正在载入... manually_select: 手动选择不同的区域 notes_layer_name: 浏览注释 diff --git a/test/functional/browse_controller_test.rb b/test/functional/browse_controller_test.rb index 0f1ff6855..2dcf6b330 100644 --- a/test/functional/browse_controller_test.rb +++ b/test/functional/browse_controller_test.rb @@ -41,41 +41,36 @@ class BrowseControllerTest < ActionController::TestCase ) end - def test_start - xhr :get, :start - assert_response :success - end - def test_read_relation - browse_check 'relation', relations(:visible_relation).relation_id + browse_check 'relation', relations(:visible_relation).relation_id, 'browse/feature' end def test_read_relation_history - browse_check 'relation_history', relations(:visible_relation).relation_id + browse_check 'relation_history', relations(:visible_relation).relation_id, 'browse/history' end def test_read_way - browse_check 'way', ways(:visible_way).way_id + browse_check 'way', ways(:visible_way).way_id, 'browse/feature' end def test_read_way_history - browse_check 'way_history', ways(:visible_way).way_id + browse_check 'way_history', ways(:visible_way).way_id, 'browse/history' end def test_read_node - browse_check 'node', nodes(:visible_node).node_id + browse_check 'node', nodes(:visible_node).node_id, 'browse/feature' end def test_read_node_history - browse_check 'node_history', nodes(:visible_node).node_id + browse_check 'node_history', nodes(:visible_node).node_id, 'browse/history' end def test_read_changeset - browse_check 'changeset', changesets(:normal_user_first_change).id + browse_check 'changeset', changesets(:normal_user_first_change).id, 'browse/changeset' end def test_read_note - browse_check 'note', notes(:open_note).id + browse_check 'note', notes(:open_note).id, 'browse/note' end ## @@ -89,41 +84,37 @@ class BrowseControllerTest < ActionController::TestCase def test_redacted_node_history get :node_history, :id => nodes(:redacted_node_redacted_version).node_id assert_response :success - assert_template 'node_history' + assert_template 'browse/history' # there are 2 revisions of the redacted node, but only one # should be showing details here. - assert_select "body div#content div.browse_details", 2 - assert_select "body div#content div.browse_details[id=1] div.common", 0 - assert_select "body div#content div.browse_details[id=2] div.common", 1 + assert_select ".browse-section", 2 + assert_select ".browse-section.browse-redacted", 1 + assert_select ".browse-section.browse-node", 1 end def test_redacted_way_history get :way_history, :id => ways(:way_with_redacted_versions_v1).way_id assert_response :success - assert_template 'way_history' + assert_template 'browse/history' # there are 4 revisions of the redacted way, but only 2 # should be showing details here. - assert_select "body div#content div.browse_details", 4 - assert_select "body div#content div.browse_details[id=1] div.common", 1 - assert_select "body div#content div.browse_details[id=2] div.common", 0 - assert_select "body div#content div.browse_details[id=3] div.common", 0 - assert_select "body div#content div.browse_details[id=4] div.common", 1 + assert_select ".browse-section", 4 + assert_select ".browse-section.browse-redacted", 2 + assert_select ".browse-section.browse-way", 2 end def test_redacted_relation_history get :relation_history, :id => relations(:relation_with_redacted_versions_v1).relation_id assert_response :success - assert_template 'relation_history' + assert_template 'browse/history' # there are 4 revisions of the redacted relation, but only 2 # should be showing details here. - assert_select "body div#content div.browse_details", 4 - assert_select "body div#content div.browse_details[id=1] div.common", 1 - assert_select "body div#content div.browse_details[id=2] div.common", 0 - assert_select "body div#content div.browse_details[id=3] div.common", 0 - assert_select "body div#content div.browse_details[id=4] div.common", 1 + assert_select ".browse-section", 4 + assert_select ".browse-section.browse-redacted", 2 + assert_select ".browse-section.browse-relation", 2 end private @@ -132,7 +123,7 @@ private # First we check that when we don't have an id, it will correctly return a 404 # then we check that we get the correct 404 when a non-existant id is passed # then we check that it will get a successful response, when we do pass an id - def browse_check(type, id) + def browse_check(type, id, template) assert_raise ActionController::UrlGenerationError do get type end @@ -141,6 +132,6 @@ private end get type, {:id => id} assert_response :success - assert_template type + assert_template template end end diff --git a/test/functional/changeset_controller_test.rb b/test/functional/changeset_controller_test.rb index 05f2ff569..69811ad59 100644 --- a/test/functional/changeset_controller_test.rb +++ b/test/functional/changeset_controller_test.rb @@ -56,25 +56,13 @@ class ChangesetControllerTest < ActionController::TestCase { :controller => "changeset", :action => "list", :nearby => true } ) assert_routing( - { :path => "/browse/changesets", :method => :get }, + { :path => "/history", :method => :get }, { :controller => "changeset", :action => "list" } ) assert_routing( - { :path => "/browse/changesets/feed", :method => :get }, + { :path => "/history/feed", :method => :get }, { :controller => "changeset", :action => "feed", :format => :atom } ) - assert_recognizes( - { :controller => "changeset", :action => "list" }, - { :path => "/browse", :method => :get } - ) - assert_recognizes( - { :controller => "changeset", :action => "list" }, - { :path => "/history", :method => :get } - ) - assert_recognizes( - { :controller => "changeset", :action => "feed", :format => :atom }, - { :path => "/history/feed", :method => :get } - ) end # ----------------------- @@ -1728,14 +1716,23 @@ EOF ## # This should display the last 20 changesets closed. def test_list - changesets = Changeset.where("num_changes > 0").order(:created_at => :desc).limit(20) - assert changesets.size <= 20 get :list, {:format => "html"} assert_response :success + assert_template "changeset/history" + assert_select "h2", :text => "Changesets", :count => 1 + + get :list, {:format => "html", :bbox => '-180,-90,90,180'} + assert_response :success assert_template "list" + + changesets = Changeset. + where("num_changes > 0 and min_lon is not null"). + order(:created_at => :desc). + limit(20) + assert changesets.size <= 20 + # Now check that all 20 (or however many were returned) changesets are in the html - assert_select "h1", :text => "Changesets", :count => 1 - assert_select "div[id='changeset_list'] ul", :count => changesets.size + assert_select "li", :count => changesets.size changesets.each do |changeset| # FIXME this test needs rewriting - test for table contents end @@ -1747,7 +1744,7 @@ EOF user = users(:public_user) get :list, {:format => "html", :display_name => user.display_name} assert_response :success - assert_template "changeset/_user" + assert_template "changeset/history" ## FIXME need to add more checks to see which if edits are actually shown if your data is public end @@ -1781,7 +1778,8 @@ EOF user = users(:public_user) get :feed, {:format => "atom", :display_name => user.display_name} assert_response :success - assert_template "changeset/_user" + assert_template "changeset/list" + assert_equal "application/atom+xml", response.content_type ## FIXME need to add more checks to see which if edits are actually shown if your data is public end diff --git a/test/functional/diary_entry_controller_test.rb b/test/functional/diary_entry_controller_test.rb index 8725def3d..92d9bcffd 100644 --- a/test/functional/diary_entry_controller_test.rb +++ b/test/functional/diary_entry_controller_test.rb @@ -96,30 +96,21 @@ class DiaryEntryControllerTest < ActionController::TestCase #print @response.body #print @response.to_yaml - assert_select "html", :count => 1 do - assert_select "head", :count => 1 do - assert_select "title", :text => /New Diary Entry/, :count => 1 - end - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h1", :text => "New Diary Entry", :count => 1 - end - assert_select "div#content", :count => 1 do - # We don't care about the layout, we just care about the form fields - # that are available - assert_select "form[action='/diary/new']", :count => 1 do - assert_select "input[id=diary_entry_title][name='diary_entry[title]']", :count => 1 - assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :count => 1 - assert_select "input#latitude[name='diary_entry[latitude]'][type=text]", :count => 1 - assert_select "input#longitude[name='diary_entry[longitude]'][type=text]", :count => 1 - assert_select "input[name=commit][type=submit][value=Save]", :count => 1 - end - end - end + assert_select "title", :text => /New Diary Entry/, :count => 1 + assert_select "div.content-heading", :count => 1 do + assert_select "h1", :text => "New Diary Entry", :count => 1 + end + assert_select "div#content", :count => 1 do + # We don't care about the layout, we just care about the form fields + # that are available + assert_select "form[action='/diary/new']", :count => 1 do + assert_select "input[id=diary_entry_title][name='diary_entry[title]']", :count => 1 + assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :count => 1 + assert_select "input#latitude[name='diary_entry[latitude]'][type=text]", :count => 1 + assert_select "input#longitude[name='diary_entry[longitude]'][type=text]", :count => 1 + assert_select "input[name=commit][type=submit][value=Save]", :count => 1 end end - end def test_editing_diary_entry @@ -134,46 +125,32 @@ class DiaryEntryControllerTest < ActionController::TestCase # Verify that you get a not found error, when you pass a bogus id get(:edit, {:display_name => entry.user.display_name, :id => 9999}, {'user' => entry.user.id}) assert_response :not_found - assert_select "html", :count => 1 do - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => "No entry with the id: 9999", :count => 1 - end - end - end + assert_select "div.content-heading", :count => 1 do + assert_select "h2", :text => "No entry with the id: 9999", :count => 1 end - + # Now pass the id, and check that you can edit it, when using the same # user as the person who created the entry get(:edit, {:display_name => entry.user.display_name, :id => entry.id}, {'user' => entry.user.id}) assert_response :success - assert_select "html", :count => 1 do - assert_select "head", :count => 1 do - assert_select "title", :text => /Edit diary entry/, :count => 1 - end - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h1", :text => /Edit diary entry/, :count => 1 - end - assert_select "div#content", :count => 1 do - assert_select "form[action='/user/#{entry.user.display_name}/diary/#{entry.id}/edit'][method=post]", :count => 1 do - assert_select "input#diary_entry_title[name='diary_entry[title]'][value='#{entry.title}']", :count => 1 - assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => entry.body, :count => 1 - assert_select "select#diary_entry_language_code", :count => 1 - assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1 - assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1 - assert_select "input[name=commit][type=submit][value=Save]", :count => 1 - assert_select "input[name=commit][type=submit][value=Edit]", :count => 1 - assert_select "input[name=commit][type=submit][value=Preview]", :count => 1 - assert_select "input", :count => 7 - end - end - end + assert_select "title", :text => /Edit diary entry/, :count => 1 + assert_select "div.content-heading", :count => 1 do + assert_select "h1", :text => /Edit diary entry/, :count => 1 + end + assert_select "div#content", :count => 1 do + assert_select "form[action='/user/#{entry.user.display_name}/diary/#{entry.id}/edit'][method=post]", :count => 1 do + assert_select "input#diary_entry_title[name='diary_entry[title]'][value='#{entry.title}']", :count => 1 + assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => entry.body, :count => 1 + assert_select "select#diary_entry_language_code", :count => 1 + assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1 + assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1 + assert_select "input[name=commit][type=submit][value=Save]", :count => 1 + assert_select "input[name=commit][type=submit][value=Edit]", :count => 1 + assert_select "input[name=commit][type=submit][value=Preview]", :count => 1 + assert_select "input", :count => 7 end end - + # Now lets see if you can edit the diary entry new_title = "New Title" new_body = "This is a new body for the diary entry" @@ -191,58 +168,40 @@ class DiaryEntryControllerTest < ActionController::TestCase get :view, {:display_name => entry.user.display_name, :id => entry.id}, {'user' => entry.user.id} assert_response :success assert_template 'diary_entry/view' - assert_select "html", :count => 1 do - assert_select "head", :count => 1 do - assert_select "title", :text => /Users' diaries | /, :count => 1 - end - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => /#{entry.user.display_name}'s diary/, :count => 1 - end - assert_select "div#content", :count => 1 do - assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 - # This next line won't work if the text has been run through the htmlize function - # due to formatting that could be introduced - assert_select "p", :text => /#{new_body}/, :count => 1 - assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1 - # As we're not logged in, check that you cannot edit - #print @response.body - assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1 - end - end - end + assert_select "title", :text => /Users' diaries | /, :count => 1 + assert_select "div.content-heading", :count => 1 do + assert_select "h2", :text => /#{entry.user.display_name}'s diary/, :count => 1 + end + assert_select "div#content", :count => 1 do + assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 + # This next line won't work if the text has been run through the htmlize function + # due to formatting that could be introduced + assert_select "p", :text => /#{new_body}/, :count => 1 + assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1 + # As we're not logged in, check that you cannot edit + #print @response.body + assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1 end # and when not logged in as the user who wrote the entry get :view, {:display_name => entry.user.display_name, :id => entry.id}, {'user' => entry.user.id} assert_response :success assert_template 'diary_entry/view' - assert_select "html", :count => 1 do - assert_select "head", :count => 1 do - assert_select "title", :text => /Users' diaries | /, :count => 1 - end - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => /#{users(:normal_user).display_name}'s diary/, :count => 1 - end - assert_select "div#content", :count => 1 do - assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 - # This next line won't work if the text has been run through the htmlize function - # due to formatting that could be introduced - assert_select "p", :text => /#{new_body}/, :count => 1 - assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1 - # As we're not logged in, check that you cannot edit - assert_select "li[class=hidden show_if_user_#{entry.user.id}]", :count => 1 do - assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1 - end - end - end + assert_select "title", :text => /Users' diaries | /, :count => 1 + assert_select "div.content-heading", :count => 1 do + assert_select "h2", :text => /#{users(:normal_user).display_name}'s diary/, :count => 1 + end + assert_select "div#content", :count => 1 do + assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 + # This next line won't work if the text has been run through the htmlize function + # due to formatting that could be introduced + assert_select "p", :text => /#{new_body}/, :count => 1 + assert_select "abbr[class=geo][title=#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}]", :count => 1 + # As we're not logged in, check that you cannot edit + assert_select "li[class=hidden show_if_user_#{entry.user.id}]", :count => 1 do + assert_select "a[href='/user/#{entry.user.display_name}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1 end end - #print @response.body - end def test_edit_diary_entry_i18n @@ -261,29 +220,21 @@ class DiaryEntryControllerTest < ActionController::TestCase # Now try again when logged in get :new, {}, {:user => users(:normal_user).id} assert_response :success - assert_select "html", :count => 1 do - assert_select "head", :count => 1 do - assert_select "title", :text => /New Diary Entry/, :count => 1 - end - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h1", :text => /New Diary Entry/, :count => 1 - end - assert_select "div#content", :count => 1 do - assert_select "form[action='/diary/new'][method=post]", :count => 1 do - assert_select "input#diary_entry_title[name='diary_entry[title]']", :count => 1 - assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => "", :count => 1 - assert_select "select#diary_entry_language_code", :count => 1 - assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1 - assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1 - assert_select "input[name=commit][type=submit][value=Save]", :count => 1 - assert_select "input[name=commit][type=submit][value=Edit]", :count => 1 - assert_select "input[name=commit][type=submit][value=Preview]", :count => 1 - assert_select "input", :count => 7 - end - end - end + assert_select "title", :text => /New Diary Entry/, :count => 1 + assert_select "div.content-heading", :count => 1 do + assert_select "h1", :text => /New Diary Entry/, :count => 1 + end + assert_select "div#content", :count => 1 do + assert_select "form[action='/diary/new'][method=post]", :count => 1 do + assert_select "input#diary_entry_title[name='diary_entry[title]']", :count => 1 + assert_select "textarea#diary_entry_body[name='diary_entry[body]']", :text => "", :count => 1 + assert_select "select#diary_entry_language_code", :count => 1 + assert_select "input#latitude[name='diary_entry[latitude]']", :count => 1 + assert_select "input#longitude[name='diary_entry[longitude]']", :count => 1 + assert_select "input[name=commit][type=submit][value=Save]", :count => 1 + assert_select "input[name=commit][type=submit][value=Edit]", :count => 1 + assert_select "input[name=commit][type=submit][value=Preview]", :count => 1 + assert_select "input", :count => 7 end end @@ -320,14 +271,8 @@ class DiaryEntryControllerTest < ActionController::TestCase # Verify that you get a not found error, when you pass a bogus id post :comment, {:display_name => entry.user.display_name, :id => 9999}, {:user => users(:public_user).id} assert_response :not_found - assert_select "html", :count => 1 do - assert_select "body", :count => 1 do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => "No entry with the id: 9999", :count => 1 - end - end - end + assert_select "div.content-heading", :count => 1 do + assert_select "h2", :text => "No entry with the id: 9999", :count => 1 end # Now try again with the right id diff --git a/test/functional/geocoder_controller_test.rb b/test/functional/geocoder_controller_test.rb index d8eee97d8..e39bab80b 100644 --- a/test/functional/geocoder_controller_test.rb +++ b/test/functional/geocoder_controller_test.rb @@ -8,7 +8,7 @@ class GeocoderControllerTest < ActionController::TestCase # test all routes which lead to this controller def test_routes assert_routing( - { :path => "/geocoder/search", :method => :post }, + { :path => "/search", :method => :get }, { :controller => "geocoder", :action => "search" } ) assert_routing( diff --git a/test/functional/message_controller_test.rb b/test/functional/message_controller_test.rb index 77fdfbeb9..45d0a267c 100644 --- a/test/functional/message_controller_test.rb +++ b/test/functional/message_controller_test.rb @@ -93,7 +93,7 @@ class MessageControllerTest < ActionController::TestCase get :new, :display_name => "non_existent_user" assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" end ## diff --git a/test/functional/site_controller_test.rb b/test/functional/site_controller_test.rb index 2db756ad1..86a8fe609 100644 --- a/test/functional/site_controller_test.rb +++ b/test/functional/site_controller_test.rb @@ -40,10 +40,10 @@ class SiteControllerTest < ActionController::TestCase ) assert_routing( { :path => "/export", :method => :get }, - { :controller => "site", :action => "index", :export => true } + { :controller => "site", :action => "export" } ) assert_recognizes( - { :controller => "site", :action => "index", :export => true, :format => "html" }, + { :controller => "site", :action => "export", :format => "html" }, { :path => "/export.html", :method => :get } ) assert_routing( @@ -74,7 +74,6 @@ class SiteControllerTest < ActionController::TestCase get :index assert_response :success assert_template 'index' - assert_site_partials end def test_index_redirect @@ -122,12 +121,6 @@ class SiteControllerTest < ActionController::TestCase get :offline assert_response :success assert_template 'offline' - assert_site_partials 0 - end - - def assert_site_partials(count = 1) - assert_template :partial => '_search', :count => count - assert_template :partial => '_sidebar', :count => count end # test the right editor gets used when the user hasn't set a preference diff --git a/test/functional/user_blocks_controller_test.rb b/test/functional/user_blocks_controller_test.rb index 49fb6552f..d52ff68c4 100644 --- a/test/functional/user_blocks_controller_test.rb +++ b/test/functional/user_blocks_controller_test.rb @@ -141,13 +141,13 @@ class UserBlocksControllerTest < ActionController::TestCase get :new assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user does not exist" + assert_select "h1", "The user does not exist" # We should get an error if the user doesn't exist get :new, :display_name => "non_existent_user" assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" end ## @@ -238,13 +238,13 @@ class UserBlocksControllerTest < ActionController::TestCase post :create assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user does not exist" + assert_select "h1", "The user does not exist" # We should get an error if the user doesn't exist post :create, :display_name => "non_existent_user" assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" end ## @@ -369,7 +369,7 @@ class UserBlocksControllerTest < ActionController::TestCase get :blocks_on, :display_name => "non_existent_user" assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" # Check the list of blocks for a user that has never been blocked get :blocks_on, :display_name => users(:normal_user).display_name @@ -407,7 +407,7 @@ class UserBlocksControllerTest < ActionController::TestCase get :blocks_by, :display_name => "non_existent_user" assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" # Check the list of blocks given by one moderator get :blocks_by, :display_name => users(:moderator_user).display_name diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb index 66fcef785..1cfb1c864 100644 --- a/test/functional/user_controller_test.rb +++ b/test/functional/user_controller_test.rb @@ -397,7 +397,7 @@ class UserControllerTest < ActionController::TestCase end assert_response :success assert_template :lost_password - assert_select "div#error", /^Could not find that email address/ + assert_select ".error", /^Could not find that email address/ # Test resetting using the address as recorded for a user that has an # address which is case insensitively unique @@ -476,7 +476,7 @@ class UserControllerTest < ActionController::TestCase assert_response :success assert_template :account assert_select "div#errorExplanation", false - assert_select "div#notice", /^User information updated successfully/ + assert_select ".notice", /^User information updated successfully/ assert_select "form#accountForm > fieldset > div.form-row > div#user_description_container > div#user_description_content > textarea#user_description", user.description # Changing name to one that exists should fail @@ -484,7 +484,7 @@ class UserControllerTest < ActionController::TestCase post :account, { :display_name => user.display_name, :user => new_attributes }, { "user" => user.id } assert_response :success assert_template :account - assert_select "div#notice", false + assert_select ".notice", false assert_select "div#errorExplanation" assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name" @@ -493,7 +493,7 @@ class UserControllerTest < ActionController::TestCase post :account, { :display_name => user.display_name, :user => new_attributes }, { "user" => user.id } assert_response :success assert_template :account - assert_select "div#notice", false + assert_select ".notice", false assert_select "div#errorExplanation" assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_display_name" @@ -503,7 +503,7 @@ class UserControllerTest < ActionController::TestCase assert_response :success assert_template :account assert_select "div#errorExplanation", false - assert_select "div#notice", /^User information updated successfully/ + assert_select ".notice", /^User information updated successfully/ assert_select "form#accountForm > fieldset > div.form-row > input#user_display_name[value=?]", "new tester" # Record the change of name @@ -514,7 +514,7 @@ class UserControllerTest < ActionController::TestCase post :account, { :display_name => user.display_name, :user => user.attributes }, { "user" => user.id } assert_response :success assert_template :account - assert_select "div#notice", false + assert_select ".notice", false assert_select "div#errorExplanation" assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_new_email" @@ -523,7 +523,7 @@ class UserControllerTest < ActionController::TestCase post :account, { :display_name => user.display_name, :user => user.attributes }, { "user" => user.id } assert_response :success assert_template :account - assert_select "div#notice", false + assert_select ".notice", false assert_select "div#errorExplanation" assert_select "form#accountForm > fieldset > div.form-row > div.field_with_errors > input#user_new_email" @@ -533,7 +533,7 @@ class UserControllerTest < ActionController::TestCase assert_response :success assert_template :account assert_select "div#errorExplanation", false - assert_select "div#notice", /^User information updated successfully/ + assert_select ".notice", /^User information updated successfully/ assert_select "form#accountForm > fieldset > div.form-row > input#user_new_email[value=?]", user.new_email end @@ -548,7 +548,7 @@ class UserControllerTest < ActionController::TestCase get :view, {:display_name => "test"} assert_response :success assert_select "div#userinformation" do - assert_select "a[href=/user/test/edits]", 1 + assert_select "a[href^=/user/test/edits]", 1 assert_select "a[href=/user/test/traces]", 1 assert_select "a[href=/user/test/diary]", 1 assert_select "a[href=/user/test/diary/comments]", 1 @@ -562,7 +562,7 @@ class UserControllerTest < ActionController::TestCase get :view, {:display_name => "blocked"} assert_response :success assert_select "div#userinformation" do - assert_select "a[href=/user/blocked/edits]", 1 + assert_select "a[href^=/user/blocked/edits]", 1 assert_select "a[href=/user/blocked/traces]", 1 assert_select "a[href=/user/blocked/diary]", 1 assert_select "a[href=/user/blocked/diary/comments]", 1 @@ -576,7 +576,7 @@ class UserControllerTest < ActionController::TestCase get :view, {:display_name => "moderator"} assert_response :success assert_select "div#userinformation" do - assert_select "a[href=/user/moderator/edits]", 1 + assert_select "a[href^=/user/moderator/edits]", 1 assert_select "a[href=/user/moderator/traces]", 1 assert_select "a[href=/user/moderator/diary]", 1 assert_select "a[href=/user/moderator/diary/comments]", 1 @@ -593,7 +593,7 @@ class UserControllerTest < ActionController::TestCase get :view, {:display_name => "test"} assert_response :success assert_select "div#userinformation" do - assert_select "a[href=/user/test/edits]", 1 + assert_select "a[href^=/user/test/edits]", 1 assert_select "a[href=/traces/mine]", 1 assert_select "a[href=/user/test/diary]", 1 assert_select "a[href=/user/test/diary/comments]", 1 @@ -610,7 +610,7 @@ class UserControllerTest < ActionController::TestCase get :view, {:display_name => "test"} assert_response :success assert_select "div#userinformation" do - assert_select "a[href=/user/test/edits]", 1 + assert_select "a[href^=/user/test/edits]", 1 assert_select "a[href=/user/test/traces]", 1 assert_select "a[href=/user/test/diary]", 1 assert_select "a[href=/user/test/diary/comments]", 1 diff --git a/test/functional/user_roles_controller_test.rb b/test/functional/user_roles_controller_test.rb index e942cd0fa..4e4bd6da7 100644 --- a/test/functional/user_roles_controller_test.rb +++ b/test/functional/user_roles_controller_test.rb @@ -42,7 +42,7 @@ class UserRolesControllerTest < ActionController::TestCase end assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" # Granting a role from a user that already has it should fail assert_no_difference "UserRole.count" do @@ -100,7 +100,7 @@ class UserRolesControllerTest < ActionController::TestCase end assert_response :not_found assert_template "user/no_such_user" - assert_select "h2", "The user non_existent_user does not exist" + assert_select "h1", "The user non_existent_user does not exist" # Removing a role from a user that doesn't have it should fail assert_no_difference "UserRole.count" do diff --git a/test/integration/client_application_test.rb b/test/integration/client_application_test.rb index fd6f5ecfa..f40a96675 100644 --- a/test/integration/client_application_test.rb +++ b/test/integration/client_application_test.rb @@ -79,27 +79,16 @@ class ClientApplicationTest < ActionDispatch::IntegrationTest ## # utility method to make the HTML screening easier to read. def assert_in_heading - assert_select "html:root" do - assert_select "body" do - assert_select "div.wrapper" do - assert_select "div.content-heading" do - yield - end - end - end + assert_select "div.content-heading" do + yield end end ## # utility method to make the HTML screening easier to read. def assert_in_body - assert_select "html:root" do - assert_select "body" do - assert_select "div#content" do - yield - end - end + assert_select "div#content" do + yield end end - end diff --git a/test/integration/user_diaries_test.rb b/test/integration/user_diaries_test.rb index 79436a7db..278a68e7b 100644 --- a/test/integration/user_diaries_test.rb +++ b/test/integration/user_diaries_test.rb @@ -36,21 +36,13 @@ class UserDiariesTest < ActionDispatch::IntegrationTest # functional tests rather than this integration test # There are some things that are specific to the integratio # that need to be tested, which can't be tested in the functional tests - assert_select "html:root" do - assert_select "body" do - assert_select "div.wrapper", :count => 1 do - assert_select "div.content-heading", :count => 1 do - assert_select "h1", "New Diary Entry" - end - assert_select "div#content" do - assert_select "form[action='/diary/new']" do - assert_select "input[id=diary_entry_title]" - end - end - end + assert_select "div.content-heading", :count => 1 do + assert_select "h1", "New Diary Entry" + end + assert_select "div#content" do + assert_select "form[action='/diary/new']" do + assert_select "input[id=diary_entry_title]" end end - - end end diff --git a/test/integration/user_login_test.rb b/test/integration/user_login_test.rb index 1d7e429cf..6d8e3e7e0 100644 --- a/test/integration/user_login_test.rb +++ b/test/integration/user_login_test.rb @@ -16,17 +16,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.email, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.email, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_email_password_normal_upcase @@ -38,13 +38,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success @@ -60,13 +60,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success @@ -82,17 +82,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.email, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.email, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.email, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_email_password_public_upcase @@ -104,17 +104,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.email.upcase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.email.upcase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_email_password_public_titlecase @@ -126,17 +126,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.email.titlecase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.email.titlecase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_username_password_normal @@ -148,17 +148,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_username_password_normal_upcase @@ -170,13 +170,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success @@ -192,13 +192,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success @@ -214,17 +214,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.display_name, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.display_name, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_username_password_public_upcase @@ -236,17 +236,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.display_name.upcase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.display_name.upcase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_username_password_public_titlecase @@ -258,17 +258,17 @@ class UserLoginTest < ActionDispatch::IntegrationTest follow_redirect! assert_response :success - post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/browse"} + post '/login', {'username' => user.display_name.titlecase, 'password' => "wrong", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success assert_template 'login' - post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/browse"} + post '/login', {'username' => user.display_name.titlecase, 'password' => "test", :referer => "/history"} assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_openid_success @@ -277,7 +277,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true" follow_redirect! assert_response :success - post '/login', {'openid_url' => "http://localhost:1123/john.doe?openid.success=true", :referer => "/browse"} + post '/login', {'openid_url' => "http://localhost:1123/john.doe?openid.success=true", :referer => "/history"} assert_response :redirect res = openid_request(@response.redirect_url) @@ -286,7 +286,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template 'changeset/list' + assert_template 'changeset/history' end def test_login_openid_cancel -- 2.43.2