Permalink
Browse files

swap arguments for some `assert_equal` statements => `expected, actual`

  • Loading branch information...
1 parent b43b6d5 commit da800614cac8b5935d0fd352af4a99d73cd13de8 @senny senny committed Nov 20, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 activerecord/test/cases/timestamp_test.rb
@@ -326,31 +326,31 @@ def self.name; 'Toy'; end
def test_timestamp_attributes_for_create
toy = Toy.first
- assert_equal toy.send(:timestamp_attributes_for_create), [:created_at, :created_on]
+ assert_equal [:created_at, :created_on], toy.send(:timestamp_attributes_for_create)
end
def test_timestamp_attributes_for_update
toy = Toy.first
- assert_equal toy.send(:timestamp_attributes_for_update), [:updated_at, :updated_on]
+ assert_equal [:updated_at, :updated_on], toy.send(:timestamp_attributes_for_update)
end
def test_all_timestamp_attributes
toy = Toy.first
- assert_equal toy.send(:all_timestamp_attributes), [:created_at, :created_on, :updated_at, :updated_on]
+ assert_equal [:created_at, :created_on, :updated_at, :updated_on], toy.send(:all_timestamp_attributes)
end
def test_timestamp_attributes_for_create_in_model
toy = Toy.first
- assert_equal toy.send(:timestamp_attributes_for_create_in_model), [:created_at]
+ assert_equal [:created_at], toy.send(:timestamp_attributes_for_create_in_model)
end
def test_timestamp_attributes_for_update_in_model
toy = Toy.first
- assert_equal toy.send(:timestamp_attributes_for_update_in_model), [:updated_at]
+ assert_equal [:updated_at], toy.send(:timestamp_attributes_for_update_in_model)
end
def test_all_timestamp_attributes_in_model
toy = Toy.first
- assert_equal toy.send(:all_timestamp_attributes_in_model), [:created_at, :updated_at]
+ assert_equal [:created_at, :updated_at], toy.send(:all_timestamp_attributes_in_model)
end
end

3 comments on commit da80061

Owner

fxn replied Nov 20, 2013

❤️

@senny 👍

Now I'm just wondering why are we testing what I believe is private api like that?

Member

senny replied Nov 21, 2013

@carlosantoniodasilva I assumed it's public API, you might want to change the columns in a subclass and overwrite these methods.

Please sign in to comment.