]> git.openstreetmap.org Git - rails.git/commitdiff
Pluralize diary entries controller
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 7 Nov 2018 15:31:04 +0000 (16:31 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 7 Nov 2018 15:31:04 +0000 (16:31 +0100)
19 files changed:
app/controllers/diary_entries_controller.rb [moved from app/controllers/diary_entry_controller.rb with 82% similarity]
app/views/diary_entries/_diary_comment.html.erb [moved from app/views/diary_entry/_diary_comment.html.erb with 100% similarity]
app/views/diary_entries/_diary_entry.html.erb [moved from app/views/diary_entry/_diary_entry.html.erb with 95% similarity]
app/views/diary_entries/_diary_index_entry.html.erb [moved from app/views/diary_entry/_diary_index_entry.html.erb with 100% similarity]
app/views/diary_entries/_location.html.erb [moved from app/views/diary_entry/_location.html.erb with 100% similarity]
app/views/diary_entries/comments.html.erb [moved from app/views/diary_entry/comments.html.erb with 100% similarity]
app/views/diary_entries/edit.html.erb [moved from app/views/diary_entry/edit.html.erb with 96% similarity]
app/views/diary_entries/index.html.erb [moved from app/views/diary_entry/index.html.erb with 87% similarity]
app/views/diary_entries/no_such_entry.html.erb [moved from app/views/diary_entry/no_such_entry.html.erb with 100% similarity]
app/views/diary_entries/rss.rss.builder [moved from app/views/diary_entry/rss.rss.builder with 100% similarity]
app/views/diary_entries/show.html.erb [moved from app/views/diary_entry/show.html.erb with 100% similarity]
app/views/users/show.html.erb
config/locales/en.yml
config/routes.rb
test/controllers/diary_entries_controller_test.rb [moved from test/controllers/diary_entry_controller_test.rb with 94% similarity]
test/helpers/application_helper_test.rb
test/integration/user_diaries_test.rb
test/system/report_diary_comment_test.rb
test/system/report_diary_entry_test.rb

similarity index 82%
rename from app/controllers/diary_entry_controller.rb
rename to app/controllers/diary_entries_controller.rb
index 70cb1654da8c9d0f7adf5b56197d482d81d54626..456ce99adc92499713a5e7995c37789b65b477e1 100644 (file)
@@ -1,4 +1,4 @@
-class DiaryEntryController < ApplicationController
+class DiaryEntriesController < ApplicationController
   layout "site", :except => :rss
 
   before_action :authorize_web
@@ -12,7 +12,7 @@ class DiaryEntryController < ApplicationController
   before_action :allow_thirdparty_images, :only => [:new, :edit, :index, :show, :comments]
 
   def new
-    @title = t "diary_entry.new.title"
+    @title = t "diary_entries.new.title"
 
     if request.post?
       @diary_entry = DiaryEntry.new(entry_params)
@@ -44,7 +44,7 @@ class DiaryEntryController < ApplicationController
   end
 
   def edit
-    @title = t "diary_entry.edit.title"
+    @title = t "diary_entries.edit.title"
     @diary_entry = DiaryEntry.find(params[:id])
 
     if current_user != @diary_entry.user
@@ -105,7 +105,7 @@ class DiaryEntryController < ApplicationController
       @user = User.active.find_by(:display_name => params[:display_name])
 
       if @user
-        @title = t "diary_entry.index.user_title", :user => @user.display_name
+        @title = t "diary_entries.index.user_title", :user => @user.display_name
         @entries = @user.diary_entries
       else
         render_unknown_user params[:display_name]
@@ -113,7 +113,7 @@ class DiaryEntryController < ApplicationController
       end
     elsif params[:friends]
       if current_user
-        @title = t "diary_entry.index.title_friends"
+        @title = t "diary_entries.index.title_friends"
         @entries = DiaryEntry.where(:user_id => current_user.friend_users)
       else
         require_user
@@ -121,7 +121,7 @@ class DiaryEntryController < ApplicationController
       end
     elsif params[:nearby]
       if current_user
-        @title = t "diary_entry.index.title_nearby"
+        @title = t "diary_entries.index.title_nearby"
         @entries = DiaryEntry.where(:user_id => current_user.nearby)
       else
         require_user
@@ -131,10 +131,10 @@ class DiaryEntryController < ApplicationController
       @entries = DiaryEntry.joins(:user).where(:users => { :status => %w[active confirmed] })
 
       if params[:language]
-        @title = t "diary_entry.index.in_language_title", :language => Language.find(params[:language]).english_name
+        @title = t "diary_entries.index.in_language_title", :language => Language.find(params[:language]).english_name
         @entries = @entries.where(:language_code => params[:language])
       else
-        @title = t "diary_entry.index.title"
+        @title = t "diary_entries.index.title"
       end
     end
 
@@ -156,9 +156,9 @@ class DiaryEntryController < ApplicationController
 
       if user
         @entries = user.diary_entries
-        @title = t("diary_entry.feed.user.title", :user => user.display_name)
-        @description = t("diary_entry.feed.user.description", :user => user.display_name)
-        @link = url_for :controller => "diary_entry", :action => "index", :display_name => user.display_name, :host => SERVER_URL, :protocol => SERVER_PROTOCOL
+        @title = t("diary_entries.feed.user.title", :user => user.display_name)
+        @description = t("diary_entries.feed.user.description", :user => user.display_name)
+        @link = url_for :action => "index", :display_name => user.display_name, :host => SERVER_URL, :protocol => SERVER_PROTOCOL
       else
         head :not_found
         return
@@ -168,13 +168,13 @@ class DiaryEntryController < ApplicationController
 
       if params[:language]
         @entries = @entries.where(:language_code => params[:language])
-        @title = t("diary_entry.feed.language.title", :language_name => Language.find(params[:language]).english_name)
-        @description = t("diary_entry.feed.language.description", :language_name => Language.find(params[:language]).english_name)
-        @link = url_for :controller => "diary_entry", :action => "index", :language => params[:language], :host => SERVER_URL, :protocol => SERVER_PROTOCOL
+        @title = t("diary_entries.feed.language.title", :language_name => Language.find(params[:language]).english_name)
+        @description = t("diary_entries.feed.language.description", :language_name => Language.find(params[:language]).english_name)
+        @link = url_for :action => "index", :language => params[:language], :host => SERVER_URL, :protocol => SERVER_PROTOCOL
       else
-        @title = t("diary_entry.feed.all.title")
-        @description = t("diary_entry.feed.all.description")
-        @link = url_for :controller => "diary_entry", :action => "index", :host => SERVER_URL, :protocol => SERVER_PROTOCOL
+        @title = t("diary_entries.feed.all.title")
+        @description = t("diary_entries.feed.all.description")
+        @link = url_for :action => "index", :host => SERVER_URL, :protocol => SERVER_PROTOCOL
       end
     end
 
@@ -184,9 +184,9 @@ class DiaryEntryController < ApplicationController
   def show
     @entry = @user.diary_entries.visible.where(:id => params[:id]).first
     if @entry
-      @title = t "diary_entry.show.title", :user => params[:display_name], :title => @entry.title
+      @title = t "diary_entries.show.title", :user => params[:display_name], :title => @entry.title
     else
-      @title = t "diary_entry.no_such_entry.title", :id => params[:id]
+      @title = t "diary_entries.no_such_entry.title", :id => params[:id]
       render :action => "no_such_entry", :status => :not_found
     end
   end
similarity index 95%
rename from app/views/diary_entry/_diary_entry.html.erb
rename to app/views/diary_entries/_diary_entry.html.erb
index ec2f22601ce625925ec8dbe6fea0dea465d2744d..e41eeae662dc5d5167e6149b3d5bbc19e49f3ffc 100644 (file)
@@ -7,7 +7,7 @@
     <h2><%= link_to h(diary_entry.title), diary_entry_path(diary_entry.user, diary_entry) %></h2>
 
     <small class='deemphasize'>
-      <%= raw(t '.posted_by', :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entry', :action => 'index', :display_name => nil, :language => diary_entry.language_code)) %>
+      <%= raw(t '.posted_by', :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to h(diary_entry.language.name), :controller => 'diary_entries', :action => 'index', :display_name => nil, :language => diary_entry.language_code)) %>
     </small>
 
   </div>
similarity index 96%
rename from app/views/diary_entry/edit.html.erb
rename to app/views/diary_entries/edit.html.erb
index d408938e5ac8aafd8e49a700e13f66fe5d9c9ed1..b46dadf1cfd3dde7f8df3ec0bda403ba3b9c3edb 100644 (file)
@@ -43,7 +43,7 @@
     </fieldset>
 
     <% if action_name == 'new' %>
-      <%= submit_tag t('diary_entry.new.publish_button') %>
+      <%= submit_tag t('diary_entries.new.publish_button') %>
     <% else %>
       <%= submit_tag t('.save_button') %>
     <% end %>
similarity index 87%
rename from app/views/diary_entry/index.html.erb
rename to app/views/diary_entries/index.html.erb
index 021cb205847ffa466f061536507100f9d7372da4..63a805b3c5be2679740e5a5b74f81142946584de 100644 (file)
       <% if @user %>
         <% if @user == current_user %>
           <div>
-            <li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('.new_title')} %></li>
+            <li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('.new'), diary_new_path, {:title => t('.new_title')} %></li>
           </div>
         <% end %>
       <% else %>
         <% if current_user %>
           <div>
-            <li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('.new'), {:controller => 'diary_entry', :action => 'new'}, {:title => t('.new_title')} %></li>
+            <li><%= link_to image_tag("new.png", :class => "small_icon", :border=>0) + t('.new'), diary_new_path, {:title => t('.new_title')} %></li>
           </div>
         <% end %>
       <% end %>
index 7aa3abd2782b958ee8761ca7edf25f7d1d44e052..c7a41b687b71c300068a07fc58a308c70cda7374 100644 (file)
             <span class='count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
           </li>
           <li>
-            <%= link_to t('.my diary'), :controller => 'diary_entry', :action => 'index', :display_name => current_user.display_name %>
+            <%= link_to t('.my diary'), :controller => 'diary_entries', :action => 'index', :display_name => current_user.display_name %>
             <span class='count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
           </li>
           <li>
-            <%= link_to t('.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => current_user.display_name %>
+            <%= link_to t('.my comments' ), :controller => 'diary_entries', :action => 'comments', :display_name => current_user.display_name %>
           </li>
           <li>
             <%= link_to t('.my settings'), :controller => 'users', :action => 'account', :display_name => current_user.display_name %>
             <%= link_to t('.send message'), new_message_path(@user) %>
           </li>
           <li>
-            <%= link_to t('.diary'), :controller => 'diary_entry', :action => 'index', :display_name => @user.display_name %>
+            <%= link_to t('.diary'), :controller => 'diary_entries', :action => 'index', :display_name => @user.display_name %>
             <span class='count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
           </li>
           <li>
-            <%= link_to t('.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @user.display_name %>
+            <%= link_to t('.comments'), :controller => 'diary_entries', :action => 'comments', :display_name => @user.display_name %>
           </li>
           <li>
             <% if current_user and current_user.is_friends_with?(@user) %>
index a9370018aabba1ad6ddecff6fdd0f786c208f044..d0b574a0966bb134f1ca4c5f2179a9e55a5dec0f 100644 (file)
@@ -249,7 +249,7 @@ en:
       commented_at_html: "Updated %{when} ago"
       commented_at_by_html: "Updated %{when} ago by %{user}"
       full: Full discussion
-  diary_entry:
+  diary_entries:
     new:
       title: New Diary Entry
       publish_button: "Publish"
index 71fcfd57dea6de3296a88fdf460a1942debf743f..1f25a62c68fe6bcdd870d7c758fa9ef81d50562b 100644 (file)
@@ -214,24 +214,24 @@ OpenStreetMap::Application.routes.draw do
   post "/trace/:id/delete" => "traces#delete", :id => /\d+/
 
   # diary pages
-  match "/diary/new" => "diary_entry#new", :via => [:get, :post]
-  get "/diary/friends" => "diary_entry#index", :friends => true, :as => "friend_diaries"
-  get "/diary/nearby" => "diary_entry#index", :nearby => true, :as => "nearby_diaries"
-  get "/user/:display_name/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
-  get "/diary/:language/rss" => "diary_entry#rss", :defaults => { :format => :rss }
-  get "/diary/rss" => "diary_entry#rss", :defaults => { :format => :rss }
-  get "/user/:display_name/diary/comments/:page" => "diary_entry#comments", :page => /[1-9][0-9]*/
-  get "/user/:display_name/diary/comments/" => "diary_entry#comments"
-  get "/user/:display_name/diary" => "diary_entry#index"
-  get "/diary/:language" => "diary_entry#index"
-  get "/diary" => "diary_entry#index"
-  get "/user/:display_name/diary/:id" => "diary_entry#show", :id => /\d+/, :as => :diary_entry
-  post "/user/:display_name/diary/:id/newcomment" => "diary_entry#comment", :id => /\d+/
-  match "/user/:display_name/diary/:id/edit" => "diary_entry#edit", :via => [:get, :post], :id => /\d+/
-  post "/user/:display_name/diary/:id/hide" => "diary_entry#hide", :id => /\d+/, :as => :hide_diary_entry
-  post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entry#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
-  post "/user/:display_name/diary/:id/subscribe" => "diary_entry#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
-  post "/user/:display_name/diary/:id/unsubscribe" => "diary_entry#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
+  match "/diary/new" => "diary_entries#new", :via => [:get, :post]
+  get "/diary/friends" => "diary_entries#index", :friends => true, :as => "friend_diaries"
+  get "/diary/nearby" => "diary_entries#index", :nearby => true, :as => "nearby_diaries"
+  get "/user/:display_name/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
+  get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss }
+  get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
+  get "/user/:display_name/diary/comments/:page" => "diary_entries#comments", :page => /[1-9][0-9]*/
+  get "/user/:display_name/diary/comments/" => "diary_entries#comments"
+  get "/user/:display_name/diary" => "diary_entries#index"
+  get "/diary/:language" => "diary_entries#index"
+  get "/diary" => "diary_entries#index"
+  get "/user/:display_name/diary/:id" => "diary_entries#show", :id => /\d+/, :as => :diary_entry
+  post "/user/:display_name/diary/:id/newcomment" => "diary_entries#comment", :id => /\d+/
+  match "/user/:display_name/diary/:id/edit" => "diary_entries#edit", :via => [:get, :post], :id => /\d+/
+  post "/user/:display_name/diary/:id/hide" => "diary_entries#hide", :id => /\d+/, :as => :hide_diary_entry
+  post "/user/:display_name/diary/:id/hidecomment/:comment" => "diary_entries#hidecomment", :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment
+  post "/user/:display_name/diary/:id/subscribe" => "diary_entries#subscribe", :as => :diary_entry_subscribe, :id => /\d+/
+  post "/user/:display_name/diary/:id/unsubscribe" => "diary_entries#unsubscribe", :as => :diary_entry_unsubscribe, :id => /\d+/
 
   # user pages
   get "/user/:display_name" => "users#show", :as => "user"
similarity index 94%
rename from test/controllers/diary_entry_controller_test.rb
rename to test/controllers/diary_entries_controller_test.rb
index cec2250476fe17e8c89668f79f90314544261032..426bc3851619c35d89e8d48b5acd1901aa75438e 100644 (file)
@@ -1,6 +1,6 @@
 require "test_helper"
 
-class DiaryEntryControllerTest < ActionController::TestCase
+class DiaryEntriesControllerTest < ActionController::TestCase
   include ActionView::Helpers::NumberHelper
 
   def setup
@@ -16,86 +16,86 @@ class DiaryEntryControllerTest < ActionController::TestCase
   def test_routes
     assert_routing(
       { :path => "/diary", :method => :get },
-      { :controller => "diary_entry", :action => "index" }
+      { :controller => "diary_entries", :action => "index" }
     )
     assert_routing(
       { :path => "/diary/language", :method => :get },
-      { :controller => "diary_entry", :action => "index", :language => "language" }
+      { :controller => "diary_entries", :action => "index", :language => "language" }
     )
     assert_routing(
       { :path => "/user/username/diary", :method => :get },
-      { :controller => "diary_entry", :action => "index", :display_name => "username" }
+      { :controller => "diary_entries", :action => "index", :display_name => "username" }
     )
     assert_routing(
       { :path => "/diary/friends", :method => :get },
-      { :controller => "diary_entry", :action => "index", :friends => true }
+      { :controller => "diary_entries", :action => "index", :friends => true }
     )
     assert_routing(
       { :path => "/diary/nearby", :method => :get },
-      { :controller => "diary_entry", :action => "index", :nearby => true }
+      { :controller => "diary_entries", :action => "index", :nearby => true }
     )
 
     assert_routing(
       { :path => "/diary/rss", :method => :get },
-      { :controller => "diary_entry", :action => "rss", :format => :rss }
+      { :controller => "diary_entries", :action => "rss", :format => :rss }
     )
     assert_routing(
       { :path => "/diary/language/rss", :method => :get },
-      { :controller => "diary_entry", :action => "rss", :language => "language", :format => :rss }
+      { :controller => "diary_entries", :action => "rss", :language => "language", :format => :rss }
     )
     assert_routing(
       { :path => "/user/username/diary/rss", :method => :get },
-      { :controller => "diary_entry", :action => "rss", :display_name => "username", :format => :rss }
+      { :controller => "diary_entries", :action => "rss", :display_name => "username", :format => :rss }
     )
 
     assert_routing(
       { :path => "/user/username/diary/comments", :method => :get },
-      { :controller => "diary_entry", :action => "comments", :display_name => "username" }
+      { :controller => "diary_entries", :action => "comments", :display_name => "username" }
     )
     assert_routing(
       { :path => "/user/username/diary/comments/1", :method => :get },
-      { :controller => "diary_entry", :action => "comments", :display_name => "username", :page => "1" }
+      { :controller => "diary_entries", :action => "comments", :display_name => "username", :page => "1" }
     )
 
     assert_routing(
       { :path => "/diary/new", :method => :get },
-      { :controller => "diary_entry", :action => "new" }
+      { :controller => "diary_entries", :action => "new" }
     )
     assert_routing(
       { :path => "/diary/new", :method => :post },
-      { :controller => "diary_entry", :action => "new" }
+      { :controller => "diary_entries", :action => "new" }
     )
     assert_routing(
       { :path => "/user/username/diary/1", :method => :get },
-      { :controller => "diary_entry", :action => "show", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "show", :display_name => "username", :id => "1" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/edit", :method => :get },
-      { :controller => "diary_entry", :action => "edit", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "edit", :display_name => "username", :id => "1" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/edit", :method => :post },
-      { :controller => "diary_entry", :action => "edit", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "edit", :display_name => "username", :id => "1" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/newcomment", :method => :post },
-      { :controller => "diary_entry", :action => "comment", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "comment", :display_name => "username", :id => "1" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/hide", :method => :post },
-      { :controller => "diary_entry", :action => "hide", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "hide", :display_name => "username", :id => "1" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/hidecomment/2", :method => :post },
-      { :controller => "diary_entry", :action => "hidecomment", :display_name => "username", :id => "1", :comment => "2" }
+      { :controller => "diary_entries", :action => "hidecomment", :display_name => "username", :id => "1", :comment => "2" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/subscribe", :method => :post },
-      { :controller => "diary_entry", :action => "subscribe", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "subscribe", :display_name => "username", :id => "1" }
     )
     assert_routing(
       { :path => "/user/username/diary/1/unsubscribe", :method => :post },
-      { :controller => "diary_entry", :action => "unsubscribe", :display_name => "username", :id => "1" }
+      { :controller => "diary_entries", :action => "unsubscribe", :display_name => "username", :id => "1" }
     )
   end
 
@@ -316,7 +316,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
         :params => { :display_name => entry.user.display_name, :id => entry.id },
         :session => { :user => entry.user }
     assert_response :success
-    assert_template "diary_entry/show"
+    assert_template "show"
     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
@@ -337,7 +337,7 @@ class DiaryEntryControllerTest < ActionController::TestCase
         :params => { :display_name => entry.user.display_name, :id => entry.id },
         :session => { :user => create(:user) }
     assert_response :success
-    assert_template "diary_entry/show"
+    assert_template "show"
     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
index 89e5a38937c221bc32db5d2710b18bfe65d6185e..050fa0e9f169597b5a73581b17b35cc957d12f1e 100644 (file)
@@ -38,7 +38,7 @@ class ApplicationHelperTest < ActionView::TestCase
   end
 
   def test_rss_link_to
-    link = rss_link_to(:controller => :diary_entry, :action => :rss)
+    link = rss_link_to(:controller => :diary_entries, :action => :rss)
     assert_dom_equal "<a class=\"rsssmall\" href=\"/diary/rss\"><img border=\"0\" height=\"16\" src=\"/images/RSS.png\" width=\"16\" /></a>", link
   end
 
index 57b4a8b0c97d3bb68604ef3d498cc4355f459713..026028d5f23d83e44073a2a814966c4160ef9ec7 100644 (file)
@@ -29,7 +29,7 @@ class UserDiariesTest < ActionDispatch::IntegrationTest
     follow_redirect!
 
     assert_response :success
-    assert_template "diary_entry/edit"
+    assert_template "diary_entries/edit"
     # print @response.body
     # print @html_document.to_yaml
 
index 18be7e649103743a2ffa540b3e72d6db6e573455..61879a32f0b3961ecd1ad7d69df9614e6d311539 100644 (file)
@@ -11,7 +11,7 @@ class ReportDiaryCommentTest < ApplicationSystemTestCase
     visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
     assert page.has_content?(@comment.body)
 
-    assert_not page.has_content?(I18n.t("diary_entry.diary_comment.report"))
+    assert_not page.has_content?(I18n.t("diary_entries.diary_comment.report"))
   end
 
   def test_it_works
@@ -19,7 +19,7 @@ class ReportDiaryCommentTest < ApplicationSystemTestCase
     visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
     assert page.has_content? @diary_entry.title
 
-    click_on I18n.t("diary_entry.diary_comment.report")
+    click_on I18n.t("diary_entries.diary_comment.report")
     assert page.has_content? "Report"
     assert page.has_content? I18n.t("reports.new.disclaimer.intro")
 
index 1db733ab7ca510e0bc38a63ed86efcca5349696a..9d232f8d465f2797a8a5917c603ec7248dc22251 100644 (file)
@@ -10,7 +10,7 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase
     visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
     assert page.has_content?(@diary_entry.title)
 
-    assert_not page.has_content?(I18n.t("diary_entry.diary_entry.report"))
+    assert_not page.has_content?(I18n.t("diary_entries.diary_entry.report"))
   end
 
   def test_it_works
@@ -18,7 +18,7 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase
     visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
     assert page.has_content? @diary_entry.title
 
-    click_on I18n.t("diary_entry.diary_entry.report")
+    click_on I18n.t("diary_entries.diary_entry.report")
     assert page.has_content? "Report"
     assert page.has_content? I18n.t("reports.new.disclaimer.intro")
 
@@ -42,7 +42,7 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase
     visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
     assert page.has_content? @diary_entry.title
 
-    click_on I18n.t("diary_entry.diary_entry.report")
+    click_on I18n.t("diary_entries.diary_entry.report")
     assert page.has_content? "Report"
     assert page.has_content? I18n.t("reports.new.disclaimer.intro")