diff --git a/app/assets/javascripts/clientUpdate.js b/app/assets/javascripts/clientUpdate.js index 8ea189f5a..5a6d873e8 100644 --- a/app/assets/javascripts/clientUpdate.js +++ b/app/assets/javascripts/clientUpdate.js @@ -88,7 +88,7 @@ // if the current version doesn't not match the server version, attempt to do an upgrade function shouldUpdate(currentVersion, version) { - if(version == null || version == "") { + if(version === undefined || version == null || version == "") { return false; } else { diff --git a/config/environments/test.rb b/config/environments/test.rb index 2f64022c5..217f3b733 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -51,5 +51,9 @@ SampleApp::Application.configure do else config.websocket_gateway_enable = false end + + # this is totally awful and silly; the reason this exists is so that if you upload an artifact + # through jam-admin, then jam-web can point users at it. I think 99% of devs won't even see or care about this config, and 0% of users + config.jam_admin_root_url = 'http://localhost:3333' end diff --git a/spec/requests/artifacts_api_spec.rb b/spec/requests/artifacts_api_spec.rb index 93eb54529..5c785cd19 100644 --- a/spec/requests/artifacts_api_spec.rb +++ b/spec/requests/artifacts_api_spec.rb @@ -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.url, "size" => @artifact.size, "sha1" => @artifact.sha1}) + JSON.parse(last_response.body).should eql({ "version" => @artifact.version, "uri" => Rails.application.config.jam_admin_root_url + @artifact.uri.url, "size" => @artifact.size, "sha1" => @artifact.sha1}) end it "matches no artifact" do diff --git a/spec/requests/music_sessions_api_spec.rb b/spec/requests/music_sessions_api_spec.rb index 29a6d9d6c..508b5f67d 100644 --- a/spec/requests/music_sessions_api_spec.rb +++ b/spec/requests/music_sessions_api_spec.rb @@ -561,14 +561,9 @@ describe "Music Session API ", :type => :api do music_session = FactoryGirl.create(:music_session, :creator => user, :description => "My Session") client = FactoryGirl.create(:connection, :user => user) - - - puts MusicSessionHistory.find_by_music_session_id(music_session.id) - put "/api/sessions/#{music_session.id}/perf.json", "CONTENT_TYPE" => "application/json" last_response.status.should == 302 redirect = last_response.headers["Location"] - p redirect put redirect + '.json', "CONTENT_TYPE" => 'application/json' last_response.status.should == 200