* adding test file to satisfy carrierwave-based model
This commit is contained in:
parent
3c692bbe7c
commit
0ddecbf0b2
|
|
@ -23,6 +23,9 @@ doc/
|
|||
.idea
|
||||
*.iml
|
||||
|
||||
|
||||
artifacts
|
||||
|
||||
Gemfile.lock
|
||||
.sass-cache
|
||||
log/development.log.age
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class ArtifactsController < ApiController
|
|||
if @artifact.nil?
|
||||
render :json => {}, :status => :ok
|
||||
else
|
||||
render :json => { "version" => @artifact.version, "uri" => @artifact.uri }, :status => :ok
|
||||
render :json => { "version" => @artifact.version, "uri" => @artifact.uri.path }, :status => :ok
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
include ActionDispatch::TestProcess # added for artifact_update http://stackoverflow.com/questions/5990835/factory-with-carrierwave-upload-field
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :user, :class => JamRuby::User do
|
||||
sequence(:email) { |n| "person_#{n}@example.com"}
|
||||
|
|
@ -80,7 +82,7 @@ FactoryGirl.define do
|
|||
|
||||
factory :artifact_update, :class => JamRuby::ArtifactUpdate do
|
||||
sequence(:version) { |n| "0.1.#{n}" }
|
||||
uri { "http://somewhere/jkclient.msi" }
|
||||
uri { fixture_file_upload("#{Rails.root.to_s}/spec/fixtures/files/jkclient.exe", "application/x-msdownload") }
|
||||
product { "JamClient/Win32" }
|
||||
environment { "public" }
|
||||
sha1 { "blurp" }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Some serious binary stuff is in here.
|
||||
010101010 beep boop 01010101
|
||||
|
|
@ -14,7 +14,7 @@ describe "Artifact API ", :type => :api do
|
|||
it "matches an artifact" do
|
||||
get '/api/versioncheck.json', { :os=>'Win32', :product=>'JamClient'}
|
||||
last_response.status.should eql(200)
|
||||
JSON.parse(last_response.body).should eql({ "version" => @artifact.version, "uri" => @artifact.uri})
|
||||
JSON.parse(last_response.body).should eql({ "version" => @artifact.version, "uri" => @artifact.uri.path})
|
||||
end
|
||||
|
||||
it "matches no artifact" do
|
||||
|
|
|
|||
Loading…
Reference in New Issue