Last active
September 3, 2015 22:42
-
-
Save frankpinto/652d358a0721af2fa42d to your computer and use it in GitHub Desktop.
Failing test case w/ environment other than 'test'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class CompanyTest < ActiveSupport::TestCase | |
def test_save_logo | |
fixtures_folder = Rails.root + 'test/fixtures/' | |
test_image_path = File.expand_path 'test-image.png', fixtures_folder | |
@test_image = File.open test_image_path, 'rb' | |
company = Company.new(name: 'Logo test') | |
company.logo = @test_image | |
#company.save | |
retrieved = Company.where(name: 'Logo test').first | |
assert_not_nil retrieved.logo | |
assert_equal 'test-image.png', retrieved.logo.original_filename | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment