diff --git a/web/app/assets/javascripts/jamkazam.js b/web/app/assets/javascripts/jamkazam.js index b3ab70e8f..a0a504c73 100644 --- a/web/app/assets/javascripts/jamkazam.js +++ b/web/app/assets/javascripts/jamkazam.js @@ -124,6 +124,10 @@ */ function ajaxError(jqXHR, textStatus, errorMessage) { + //var err; + //try { throw new Error('lurp'); } catch(e) { err = e }; + //console.log("TRACE", JSON.stringify(err)) + if (jqXHR.status === 404) { logger.error("Unexpected ajax error: " + textStatus + ", msg:" + errorMessage); app.notify({title: "Oops!", text: "What you were looking for is gone now."}); @@ -218,7 +222,7 @@ if (jqXHR.status == 422) { var errors = JSON.parse(jqXHR.responseText); var $errors = context.JK.format_all_errors(errors); - logger.debug("Unprocessable entity sent from server:", errors) + logger.debug("Unprocessable entity sent from server:", JSON.stringify(errors)) this.notify({title: title, text: $errors, icon_url: "/assets/content/icon_alert_big.png"}) } else if(jqXHR.status == 403) { diff --git a/web/config/environments/test.rb b/web/config/environments/test.rb index ba71cf8c2..f1c715dd7 100644 --- a/web/config/environments/test.rb +++ b/web/config/environments/test.rb @@ -15,7 +15,11 @@ SampleApp::Application.configure do config.whiny_nils = true # useful when debugging a javascript problem... - config.assets.compress = false + # config.assets.compress = false + + config.assets.compress = true # Compress precompiled assets + config.assets.compile = true # Refuse to compile assets on-the-fly + config.assets.digest = true # Show full error reports and disable caching config.consider_all_requests_local = true diff --git a/web/spec/features/event_spec.rb b/web/spec/features/event_spec.rb index 0a38ef621..a06fafb8f 100644 --- a/web/spec/features/event_spec.rb +++ b/web/spec/features/event_spec.rb @@ -27,7 +27,7 @@ describe "Events", :js => true, :type => :feature, :capybara_feature => true, :s # add an event session to the event, with nothing defined @event_session = FactoryGirl.create(:event_session, event: @event) visit "/events/so_latency" - find('.landing-band.event img')['src'].should == '/assets/web/logo-256.png' + find('.landing-band.event img')['src'].include?('/assets/web/logo-256').should be_true find('.event-title', text: 'TBD') find('.time strong', text: 'TBD') @@ -37,7 +37,7 @@ describe "Events", :js => true, :type => :feature, :capybara_feature => true, :s @event_session.save! visit "/events/so_latency" find('.landing-details.event .bio', text: band.biography) - find('.landing-band.event img')['src'].should == '/assets/shared/avatar_generic_band.png' + find('.landing-band.event img')['src'].include?('/assets/shared/avatar_generic_band').should be_true # update starts at starts_at = 1.hours.ago diff --git a/web/spec/features/sidebar_spec.rb b/web/spec/features/sidebar_spec.rb index b2a949df8..ffb93b5d4 100644 --- a/web/spec/features/sidebar_spec.rb +++ b/web/spec/features/sidebar_spec.rb @@ -34,6 +34,8 @@ describe "Profile Menu", :js => true, :type => :feature, :capybara_feature => tr describe "panel behavior" do it "search, then click notifications" do + user.reload + notification = Notification.send_text_message("text message", user2, user) notification.errors.any?.should be_false diff --git a/web/spec/features/social_meta_spec.rb b/web/spec/features/social_meta_spec.rb index 9df062b8e..c94e3e4a8 100644 --- a/web/spec/features/social_meta_spec.rb +++ b/web/spec/features/social_meta_spec.rb @@ -13,7 +13,7 @@ describe "social metadata" do page.find('meta[property="fb:app_id"]', :visible => false)['content'].should == Rails.application.config.facebook_app_id page.find('meta[property="og:title"]', :visible => false)['content'].should == "JamKazam" page.find('meta[property="og:description"]', :visible => false)['content'].should == "Play music together over the Internet as if in the same room." - page.find('meta[property="og:image"]', :visible => false)['content'].include?("/assets/web/logo-256.png").should be_true + page.find('meta[property="og:image"]', :visible => false)['content'].include?("/assets/web/logo-256").should be_true page.find('meta[property="og:image:width"]', :visible => false)['content'].should == "256" page.find('meta[property="og:image:height"]', :visible => false)['content'].should == "256" page.find('meta[property="og:type"]', :visible => false)['content'].should == "website" @@ -76,7 +76,7 @@ describe "social metadata" do page.find('meta[property="og:title"]', :visible => false)['content'].should == title_for_music_session(music_session.music_session) page.find('meta[property="og:url"]', :visible => false)['content'].include?("/sessions/#{music_session.id}").should be_true page.find('meta[property="og:description"]', :visible => false)['content'].should == music_session.music_session.description - page.find('meta[property="og:image"]', :visible => false)['content'].include?("/assets/web/logo-256.png").should be_true + page.find('meta[property="og:image"]', :visible => false)['content'].include?("/assets/web/logo-256").should be_true page.find('meta[property="og:image:width"]', :visible => false)['content'].should == "256" page.find('meta[property="og:image:height"]', :visible => false)['content'].should == "256" page.find('meta[property="og:type"]', :visible => false)['content'].should == "website" @@ -110,7 +110,7 @@ describe "social metadata" do page.find('meta[property="og:title"]', :visible => false)['content'].should == title_for_claimed_recording(@claimed_recording) page.find('meta[property="og:url"]', :visible => false)['content'].include?("/recordings/#{@claimed_recording.id}").should be_true page.find('meta[property="og:description"]', :visible => false)['content'].should == @claimed_recording.name - page.find('meta[property="og:image"]', :visible => false)['content'].include?("/assets/web/logo-256.png").should be_true + page.find('meta[property="og:image"]', :visible => false)['content'].include?("/assets/web/logo-256").should be_true page.find('meta[property="og:image:width"]', :visible => false)['content'].should == "256" page.find('meta[property="og:image:height"]', :visible => false)['content'].should == "256" page.find('meta[property="og:type"]', :visible => false)['content'].should == "website" diff --git a/web/spec/features/text_message_spec.rb b/web/spec/features/text_message_spec.rb index bec913e7e..81bebc17e 100644 --- a/web/spec/features/text_message_spec.rb +++ b/web/spec/features/text_message_spec.rb @@ -42,6 +42,7 @@ describe "Text Message", :js => true, :type => :feature, :capybara_feature => tr it "on reply of notification in sidebar" do + @user1.reload # create a notification notification = Notification.send_text_message("bibbity bobbity boo", @user2, @user1) notification.errors.any?.should be_false