assign after source url for uploads

This commit is contained in:
Albert Yi
2018-07-30 17:39:22 -07:00
parent ad4756b5f2
commit 6ce8c72053
3 changed files with 21 additions and 12 deletions

View File

@@ -353,6 +353,14 @@ class UploadServiceTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
should "record the correct source when a referer is given" do
@source = "https://pbs.twimg.com/media/B4HSEP5CUAA4xyu.png:large"
@ref = "https://twitter.com/nounproject/status/540944400767922176"
@service = subject.new(source: @source, referer_url: @ref)
@upload = @service.start!
assert_equal(@ref, @upload.source)
end
should "work for a jpeg" do
@service = subject.new(source: @jpeg)
@upload = @service.start!