* fix for failing tests

This commit is contained in:
Seth Call 2014-12-08 15:37:31 -06:00
parent 2c6eab206e
commit 566598fffc
6 changed files with 18 additions and 7 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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