]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/trace_test.rb
Fix most auto-correctable rubocop issues
[rails.git] / test / models / trace_test.rb
index 9ec40f18f40e75c610b101cef01c0a4c5d48388d..3aaf75e87602bd7613db63627e33c09225602d18 100644 (file)
@@ -2,7 +2,7 @@ require 'test_helper'
 
 class TraceTest < ActiveSupport::TestCase
   api_fixtures
 
 class TraceTest < ActiveSupport::TestCase
   api_fixtures
-  
+
   def setup
     @gpx_trace_dir = Object.send("remove_const", "GPX_TRACE_DIR")
     Object.const_set("GPX_TRACE_DIR", File.dirname(__FILE__) + "/../traces")
   def setup
     @gpx_trace_dir = Object.send("remove_const", "GPX_TRACE_DIR")
     Object.const_set("GPX_TRACE_DIR", File.dirname(__FILE__) + "/../traces")
@@ -27,8 +27,8 @@ class TraceTest < ActiveSupport::TestCase
     check_query(Trace.visible_to(3), [:public_trace_file, :identifiable_trace_file])
   end
 
     check_query(Trace.visible_to(3), [:public_trace_file, :identifiable_trace_file])
   end
 
-  def test_public
-    check_query(Trace.public, [:public_trace_file, :identifiable_trace_file, :deleted_trace_file])
+  def test_visible_to_all
+    check_query(Trace.visible_to_all, [:public_trace_file, :identifiable_trace_file, :deleted_trace_file])
   end
 
   def test_tagged
   end
 
   def test_tagged
@@ -39,17 +39,17 @@ class TraceTest < ActiveSupport::TestCase
 
   def test_validations
     trace_valid({})
 
   def test_validations
     trace_valid({})
-    trace_valid({:user_id => nil}, false)
-    trace_valid({:name => 'a'*255})
-    trace_valid({:name => 'a'*256}, false)
-    trace_valid({:description => nil}, false)
-    trace_valid({:description => 'a'*255})
-    trace_valid({:description => 'a'*256}, false)
-    trace_valid({:visibility => "private"})
-    trace_valid({:visibility => "public"})
-    trace_valid({:visibility => "trackable"})
-    trace_valid({:visibility => "identifiable"})
-    trace_valid({:visibility => "foo"}, false)
+    trace_valid({ :user_id => nil }, false)
+    trace_valid(:name => 'a' * 255)
+    trace_valid({ :name => 'a' * 256 }, false)
+    trace_valid({ :description => nil }, false)
+    trace_valid(:description => 'a' * 255)
+    trace_valid({ :description => 'a' * 256 }, false)
+    trace_valid(:visibility => "private")
+    trace_valid(:visibility => "public")
+    trace_valid(:visibility => "trackable")
+    trace_valid(:visibility => "identifiable")
+    trace_valid({ :visibility => "foo" }, false)
   end
 
   def test_tagstring
   end
 
   def test_tagstring
@@ -106,7 +106,7 @@ class TraceTest < ActiveSupport::TestCase
     assert_equal ".gpx.gz", gpx_files(:identifiable_trace_file).extension_name
   end
 
     assert_equal ".gpx.gz", gpx_files(:identifiable_trace_file).extension_name
   end
 
-private
+  private
 
   def check_query(query, traces)
     traces = traces.map { |t| gpx_files(t) }.sort
 
   def check_query(query, traces)
     traces = traces.map { |t| gpx_files(t) }.sort