diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-08-14 18:13:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 18:13:32 -0400 |
commit | cf91b96be3ff4aafd0ec29f5c34013792bddf33d (patch) | |
tree | 39b856d485ae26201e6554cdfe3d1c4056697607 /activerecord/test | |
parent | bef68862ae14244fb93e0abb4c16d06eec535c2d (diff) | |
parent | daad0736f30b7c665aa733512eac8d32873841db (diff) | |
download | rails-cf91b96be3ff4aafd0ec29f5c34013792bddf33d.tar.gz rails-cf91b96be3ff4aafd0ec29f5c34013792bddf33d.tar.bz2 rails-cf91b96be3ff4aafd0ec29f5c34013792bddf33d.zip |
Merge pull request #30073 from yalab/fixture_binary_helper
Add `binary` helper method to fixtures.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 3 | ||||
-rw-r--r-- | activerecord/test/fixtures/binaries.yml | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 6b014bcb3d..b0b63f5203 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -132,7 +132,7 @@ class FixturesTest < ActiveRecord::TestCase def test_no_args_record_returns_all_without_array all_binaries = binaries assert_kind_of(Array, all_binaries) - assert_equal 1, binaries.length + assert_equal 2, binaries.length end def test_nil_raises @@ -313,6 +313,7 @@ class FixturesTest < ActiveRecord::TestCase data.force_encoding("ASCII-8BIT") data.freeze assert_equal data, @flowers.data + assert_equal data, @binary_helper.data end def test_serialized_fixtures diff --git a/activerecord/test/fixtures/binaries.yml b/activerecord/test/fixtures/binaries.yml index ec8f2facdc..53b7883369 100644 --- a/activerecord/test/fixtures/binaries.yml +++ b/activerecord/test/fixtures/binaries.yml @@ -131,3 +131,7 @@ flowers: SgCUASgCUASgCUASgAC74PbXOTvE5/En7jpSoLE8/wBn7uPJjKyj46T9D/NT pKsXyQzxNpdNP0/akB5484WkMKh4RfXG4UafNmH7b0UxWMrb7Nxg6rl9Z/Im w+vWq0iscQwxQroiUIvkKsRZQBKAJQBKAJQB/9k= + +binary_helper: + id: 2 + data: <%= binary(ASSETS_ROOT + "/flowers.jpg") %> |